File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 8080# Now, put this very same program code above into a conditional while-loop and see
8181# what happens when the user tries to type letters, instead of typing numbers for their
8282# age. When the 'try:' statement is executed, the 'break' statement causes the
83- # conditional while-loop to break out and the 'print' statement ('End of program') is
83+ # conditional while-loop to break out and the 'print' statement ('End of program. ') is
8484# then executed.
8585
8686name = input ('\n What is your name please? ' ).lower ().strip ()
9494 except ValueError :
9595 print ('\n The \' try:\' and \' except ValueError:\' block executes/runs whenever a \
9696 letter key is pressed instead of a number key.' )
97+
98+ print ('End of program.' )
You can’t perform that action at this time.
0 commit comments