raw_input in python xand exits when the user enters "stopfor the name requestwhile truename input('enter name:'use raw_input(in if name ='stop'break age input('enter age'print('hello'name'=>'int(age* enter name:bob enter age hello bob = enter name:sue enter age hello sue = enter name:stop notice how this code converts the age input to an integer with int before raising it to the second poweras you'll recallthis is necessary because input returns user input as string in you'll see that input also raises an exception at end-of-file ( if the user types ctrl- on windows or ctrl- on unix)if this matterswrap input in try statements loop else when combined with the loop else clausethe break statement can often eliminate the need for the search status flags used in other languages for instancethe following piece of code determines whether positive integer is prime by searching for factors greater than / while if = print( 'has factor'xbreak - elseprint( 'is prime'for some remainder skip else normal exit rather than setting flag to be tested when the loop is exitedit inserts break where factor is found this waythe loop else clause can assume that it will be executed only if no factor is foundif you don' hit the breakthe number is prime trace through this code to see how this works the loop else clause is also run if the body of the loop is never executedas you don' run break in that event eitherin while loopthis happens if the test in the header is false to begin with thusin the preceding example you still get the "is primemessage if is initially less than or equal to (for instanceif is while and for loops