Save
...
mock
programing
iteration
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
emily d
Visit profile
Cards (13)
What is a condition controlled iteration used for?
When the number of repetitions is
unknown
View source
How does a condition controlled iteration terminate?
When a condition becomes
True
or
False
View source
What type of loop is used for condition controlled iteration?
While loop
View source
What does the while loop check after setting tfAnswer to True?
If tfAnswer is still
False
View source
What is a count controlled iteration used for?
When the number of
repetitions
is known
View source
What type of loop is used for count controlled iteration?
For loop
View source
What does the range function control in count controlled loops?
The number of
iterations
View source
What does the range function start counting from in Python?
0
View source
What does the range function do when given three parameters?
Controls
starting point
and
increment value
View source
What is printed when using range(1,
10,2
)
?
1, 3, 5, 7, 9
View source
What are the key differences between condition controlled and count controlled iterations?
Condition Controlled:
Unknown repetitions
Uses while loop
Count Controlled:
Known repetitions
Uses for loop
View source
What are the roles of the counter variable in condition controlled iterations?
Tracks the number of iterations
Triggers condition change when reaching a limit
Determines when to exit the
loop
View source
What are the parameters of the range function in Python?
Start point
(default is 0)
Stop point
(
exclusive
)
Step value
(default is 1)
View source