python - selection and repetition Flashcards
1
Q
types of selection statement
A
- if
- if … else
- if … elif … else / nested if
2
Q
define loop
A
statement used to execute one or more statements repeatedly until a goal is reached
3
Q
types of repetition
A
- fixed repetition
- variable repetition
4
Q
fixed repetition
A
can be determined how many times a segment of code will be repeated
5
Q
variable repetition
A
- cannot be determined how many times a segment of code will be repeated
- value true / false determined
6
Q
counter - controlled loops
A
- counting loops
- controlled by variable
- for and while loop
- fixed repetition
7
Q
event - driven loops
A
- conditional loops
- controlled by condition
- while loops only
- variable repetition
8
Q
keyword break
A
immediately terminate a loop
9
Q
keyword continue
A
ends current iteration and continue to the end of the loop