M03 - Repetition Statements Flashcards

1
Q

Condition-controlled Loop

A
  • while loop

- Uses true or false condition to control the number of times that it repeats

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Count-controlled loop

A
  • for loop

- repeats a specific number of times depending on the conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

2 parts of While loops

A
  1. Condition that is tested for a true or false value

2. A statement(s) that are repeated as long as the condition is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

while syntax

A

variable = value

while variable condition :

(tab) print(variable)
(tab) variable = variable + 1 (increment of +1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly