after the loop is exitedenter text: enter text: enter text:stop bye usage notefrom this point on 'll assume that this code is stored in and run from script filevia command lineidle menu optionor any of the other file launching techniques we met in againit' named interact py in the book' examples if you are entering this code interactivelythoughbe sure to include blank line ( press enter twicebefore the final print statementto terminate the loop this implies that you also can' cut and paste the code in its entirety into an interactive promptan extra blank line is required interactivelybut not in script files the final print doesn' quite make sense in interactive modethough--you'll have to code it after interacting with the loophandling errors by testing inputs so far so goodbut notice what happens when the input is invalidenter text:xxx error text omitted valueerrorinvalid literal for int(with base 'xxxthe built-in int function raises an exception here in the face of mistake if we want our script to be robustwe can check the string' content ahead of time with the string object' isdigit methods ' 'xxxs isdigit() isdigit((truefalsethis also gives us an excuse to further nest the statements in our example the following new version of our interactive script uses full-blown if statement to work around the exception on errorswhile truereply input('enter text:'if reply ='stop'break elif not reply isdigit()print('bad! elseprint(int(reply* print('bye' introducing python statements