while truereply input('enter text:'if reply ='stop'break print(reply upper()this code makes use of few new ideas and some we've already seenthe code leverages the python while looppython' most general looping statement we'll study the while statement in more detail laterbut in shortit consists of the word whilefollowed by an expression that is interpreted as true or false resultfollowed by nested block of code that is repeated while the test at the top is true (the word true here is considered always truethe input built-in function we met earlier in the book is used here for general console input--it prints its optional argument string as prompt and returns the user' typed reply as string use raw_input in insteadper the upcoming note single-line if statement that makes use of the special rule for nested blocks also appears herethe body of the if appears on the header line after the colon instead of being indented on new line underneath it this would work either waybut as it' codedwe've saved an extra line finallythe python break statement is used to exit the loop immediately--it simply jumps out of the loop statement altogetherand the program continues after the loop without this exit statementthe while would loop foreveras its test is always true in effectthis combination of statements essentially means "read line from the user and print it in uppercase until the user enters the word 'stop 'there are other ways to code such loopbut the form used here is very common in python code notice that all three lines nested under the while header line are indented the same amount--because they line up vertically in column this waythey are the block of code that is associated with the while test and repeated either the end of the source file or lesser-indented statement will suffice to terminate the loop body block when this code is runeither interactively or as script filehere is the sort of interaction we get--all of the code for this example is in interact py in the book' examples packageenter text:spam spam enter text: enter text:stop introducing python statements