Python_Loops
Python_Loops
loopCounter = start
Execute loop
statements
yes
Is loopCounter < stop?
no
Look at the first control line of the for loop
The variable name takes on each item in the list in turn and uses it in
a separate go of the loop. Here is the output
The structure of a while loop is as follows
while logical-statement :
statement in loop
...............
...............
statement in loop
is logical-statement True? no
yes
Execute loop
statements
Here are some examples of logical statements
number <= 10
17 > maximum
high >= low
left != right
name == “John”