appendix python review the while loopwhich is compound statementconsists of two partsa condition and loop body the body of the loop contains one or more statements that are executed for each iteration of the loop the number of iterations is determined by the conditionwhich is constructed using logical expression the body of the while loop is executed while the condition is true since logical expressions are constructed by comparing and examining the values of one or more variablesthe variables must be altered in order to change the condition thusevery loop must contain an initialization and modification component the initialization is performed before the condition is examined and the body is executed it is used to initialize the loop variable upon which the loop condition is based at some point within the loop bodythe loop variable must be modified so the loop condition can change as an example of an event-controlled loopconsider the problem of entering multiple exam grades from the user and then computing the average grade we need to enter multiple grades but we don' know how many will be entered to accommodate this unknownwe can repeatedly execute the body of the loop until the user enters special valueknown as the sentinel value in the following solution for this problemthe sentinel value is any negative number the event of entering the special value terminates the loopthus leading to the name eventcontrolled loop total count value intinput("enter the first grade"while value > total +value count + value intinput("enter the next grade (or to quit)"avg total count print"the average grade is % favg python also provides the break and continue jump statements for use in loops the break statement is used to break out of or terminate the innermost loop in which it is used the continue statement immediately jumps back to the top of the loop and starts the next iteration from the point of the condition evaluation when using real values (floatswith logical expressionsyou may get results you do not expect due to the imprecision of real number arithmetic on computers consider the following code segmenttotal while total + + if total = print"correctelse print"not correct