the except block looks for specific exception in this casevalueerror when the user creates valueerror exception by typing hello instead of numeric valuethis particular exception block is executed if the user were to generate some other exceptionthis except block wouldn' handle it the else block contains all the code that is executed when the try block code is successful (doesn' generate an exceptionthe remainder of the code is in this block because you don' want to execute it unless the user does provide valid input when the user provides whole number as inputthe code can then range check it to ensure that it' correct choose runrun module you see python shell window open the application asks you to type number between and type hello and press enter the application displays an error messageas shown in figure - figure - typing the wrong input type generates an error instead of an exception perform steps and againbut type instead of hello the application generates the same error messageas shown in figure - perform steps and againbut type instead of hello the application outputs the expected range error messageas shown in figure - exception handling doesn' weed out range errors you must still check for them separately