them you must always provide method for the loop to end when using while loop (contrasted with the for loopin which the end of the sequence determines the end of the loopsowhen working with the while statementyou must perform three tasks create the environment for the condition (such as setting sum to state the condition within the while statement (such as sum update the condition as needed to ensure that the loop eventually ends (such as adding sum+= to the while code blockas with the for statementyou can modify the default behavior of the while statement in factyou have access to the same four clauses to modify the while statement behaviorbreakends the current loop continueimmediately ends processing of the current element passends processing of the current element after completing the statements in the if block elseprovides an alternative processing technique when conditions aren' met for the loop using the while statement in an application you can use the while statement in many waysbut this first example is straightforward it simply displays count based on the starting and ending condition of variable named sum the following steps help you create and test the example code this example also appears with the downloadable source code as simplewhile py open python file window you see an editor in which you can type the example code type the following code into the window -pressing enter after each linesum while sum print(sumsum+=