not line ='of course in this situation there is shorter wayline !'run the example program readlines pyshown belowlines list(print('enter lines of text 'print('enter an empty line to quit 'line input('next line'initalize before the loop while line !''while not the termination condition lines append(lineline input('next line'!reset value at end of loopprint('your lines were:'for line in linesprint(lineagain the data for the test in the while loop heading must be initialized before the first time the while statement is executed and the test data must also be made ready inside the loop for the test after the body has executed hence you see the statements setting the variable line both before the loop and at the end of the loop body it is easy to forget the second place inside the loopafter reading the rest of this paragraphcomment the last line of the loop outand run it againit will never stopthe variable line will forever have the initial value you gave ityou actually can stop the program by entering ctrl- that means hold the ctrl key and press noteas you finish coding while loopit is good practice to always double-checkdid make change to the variablesinside the loopthat will eventually make the loop condition falsethe earliest while loop examples had numerical tests and the code to get ready for the next loop just incremented numerical variable by fixed amount those were simple examples but while loops are much more generalin the interactive loop we have seen continuation condition with string testand getting ready for the next time through the loop involves input from the user some of the exercises that follow involve interactive while loops others were delayed until here just because they have wider variety of continuation condition tests and ways to prepare for the next time through the loop what is consistent is the general steps to think of and questions to ask yourself they keep on applyingkeep these in mindthe need to see whether there is kind of repetitioneven without fixed collection of values to work through to think from the specific situation and figure out the continuation condition that makes sense for your loop to think what specific processing or results you want each time through the loopusing the same code to figure out what supporting code you need to make you ready for the next time through the loophow to make the same results code have new data values to process each time throughand eventually reach stopping point detecting the need for while statementslike with planning programs needing''for'or if statementsyou want to be able to translate english descriptions of problems that would naturally include while statements what are some words or phrases or ideas that suggest the use of these statementsthink of your own and then compare to few gave "while ___""do ___ while""repeat while""repeat until""as long as ___do""keep doing ___ as long as while statements