Week 7 Flashcards
1
Q
What are loops?
A
Loops have iteration variables that change each time through the loop. Often they gi through a sequence of numbers.
2
Q
What is an infinite loop?
A
n = 5
WHILE N > 0
print 2Lather”
3
Q
What does the break statement do?
A
it breaks out of the loop
4
Q
What does the continue statement do?
A
The continue statements ends the current iteration and jumps to the top of the loop and starts the next iteration
5
Q
How can you construct definite loops?
A
We can write a loop once for each of the items in a set using the Python for construct. These loops are called definite loops
6
Q
How do you find the largest so far value
A