do the indented block if condition is trueand at the end of the indented block loop back and test the condition againand continue repeating the indented block as long as the condition is true after completing the indented block execution does not stop in the middle of the blockeven if the condition becomes false at that point while loop can be used to set up an (intentionallyapparently infinite loop by making condition be just true to end the loop in that casethere can be test inside the loop that sometime becomes trueallowing the execution of return statement to break out of the loop [fancier animation loop logic (optional(page ) range function with three parameters [simple while loops (page )rangestart pastend step return list of elements start start step with each element step from the previous oneending just before reaching pastend if step is positivepastend is larger than the last element if step is negativepastend is smaller than the last element type tuple expression expression and so on expression (aa literal tuplewith two or more elementsconsists of comma separated collection of values all enclosed in parentheses literal tuple with only single element must have comma after the element to distinguish from regular parenthesized expression [loops and tuples (page )(ba tuple is kind of sequence (ctuplesunlike listsare immutable (may not be altered interpretation as boolean (truefalse)all python data may be converted to boolean (type boolthe only built-in data that have boolean meaning of falsein addition to false itselfare nonenumeric values equal to and empty collections or sequenceslike the empty list {[]}and the empty string '[arbitrary types treated as boolean (page ) additional programming techniques (athese techniques extend the techniques listed in the summary of the previous (page )[summary (bthe basic pattern for programming with while loop is [simple while loops (page )initialization while continuationcondition main action to repeat prepare variables for next time through loop (cinteractive while loops generally follow the pattern [interactive while loops (page )input first data from user while continationconditionbasedontestofuserdata summary