type the following code into the window -pressing enter after each linetryagain true while tryagaintryvalue int(input("type whole number ")except valueerrorprint("you must type whole number!"trydoover input("try again ( / )"exceptprint("oksee you next time!"tryagain false elseif (str upper(doover=" ")tryagain false except keyboardinterruptprint("you pressed ctrl+ !"print("see you next time!"tryagain false elseprint(valuetryagain false the code begins by creating an input loop using loops for this type of purpose is actually quite common in applications because you don' want the application to end every time an input error is made this is simplified loopand normally you create separate function to hold the code when the loop startsthe application asks the user to type whole number it can be any integer value if the user types any non-integer value or presses ctrl+ccmd+cor another interrupt key combinationthe exception-handling code takes over otherwisethe application prints the value that the user supplied and sets tryagain to falsewhich causes the loop to end valueerror exception can occur when the user makes mistake because you don' know why the user input the wrong valueyou have to ask if the user wants to try again of coursegetting more input from the user could generate another exception the inner try except code block handles this secondary input notice the use of the str upper(function when getting character input from the user this function makes it possible to receive or as input and accept them both whenever you ask the user for character inputit' good idea to convert lowercase characters to uppercase so that you can perform single comparison (reducing the potential for error