working in python xthe code works the samebut you must use raw_input instead of input in all of this examplesand you can omit the outer parentheses in print statements (though they don' hurtin factif you study the interact py file in the examples packageyou'll see that it does this automatically--to support compatibilityit resets input if the running python' major version is ("inputwinds up running raw_input)import sys if sys version[ =' 'input raw_input compatible in xraw_input was renamed inputand print is built-in function instead of statement (more on prints in the next python has an input toobut it tries to evaluate the input string as though it were python codewhich probably won' work in this contexteval(input()can yield the same effect doing math on user inputs our script worksbut now suppose that instead of converting text string to uppercasewe want to do some math with numeric input--squaring itfor exampleperhaps in some misguided effort of an age-input program to tease its users we might try statements like these to achieve the desired effectreply ' reply * error text omitted typeerrorunsupported operand type(sfor *or pow()'strand 'intthis won' quite work in our scriptthoughbecause (as discussed in the prior part of the bookpython won' convert object types in expressions unless they are all numericand input from user is always returned to our script as string we cannot raise string of digits to power unless we convert it manually to an integerint(reply* armed with this informationwe can now recode our loop to perform the necessary math type the following in file to test itwhile truereply input('enter text:'if reply ='stop'break print(int(reply* print('bye'this script uses single-line if statement to exit on "stopas beforebut it also converts inputs to perform the required math this version also adds an exit message at the bottom because the print statement in the last line is not indented as much as the quick exampleinteractive loops