FOR and WHILE Loops Flashcards
1
Q
What does a FOR Loop do?
A
Loops a definite set amount of times (range).
2
Q
What does the loop variable do?
A
Counts the number of times a loop repeats itself.
3
Q
How many times would this loop the code?
for x in range (5):
A
5 times
4
Q
Iteration definition
A
The process of repeating steps.
5
Q
How does the use of iteration impact coding?
A
It allows us to simplify our algorithm by stating that we will repeat certain steps until told otherwise. This makes designing algorithms quicker and simpler because they don’t have to include lots of unnecessary steps.