Chapter 7 Iteration Revisited
ctr = 0 while ctr < 5: print(ctr) ctr = ctr + 1
input into a variable (say, x) while x is not the sentinel value process x input into x
initialize sum to 0.0 initialize count to 0 input data item as a string, xStr while xStr is not empty convert xStr to a number, x add x to sum add 1 to count input next data item as a string, xStr Output sum / count
for i in range(5): for j in range(3): # use a different variable! print (i,j, end = " ")