the keyboardinterrupt exception displays two messages and then exits automatically by setting tryagain to false the keyboardinterrupt occurs only when the user presses specific key combination designed to end the application the user is unlikely to want to continue using the application at this point choose runrun module you see python shell window open the application asks the user to input whole number type hello and press enter the application displays an error message and asks whether you want to try again type and press enter the application asks you to input whole number againas shown in figure - figure - using loop means that the application can recover from the error type and press enter the application again displays the error message and asks whether you want to try again press ctrl+ccmd+cor another key combination to interrupt the application the application endsas shown in figure - notice that the message is the one from the inner exception the application never gets to the outer exception because the inner exception handler provides generic exception handling choose runrun module you see python shell window open the application asks the user to input whole number