python - selection and repetition Flashcards

1
Q

types of selection statement

A
  • if
  • if … else
  • if … elif … else / nested if
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define loop

A

statement used to execute one or more statements repeatedly until a goal is reached

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

types of repetition

A
  • fixed repetition
  • variable repetition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

fixed repetition

A

can be determined how many times a segment of code will be repeated

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

variable repetition

A
  • cannot be determined how many times a segment of code will be repeated
  • value true / false determined
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

counter - controlled loops

A
  • counting loops
  • controlled by variable
  • for and while loop
  • fixed repetition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

event - driven loops

A
  • conditional loops
  • controlled by condition
  • while loops only
  • variable repetition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

keyword break

A

immediately terminate a loop

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

keyword continue

A

ends current iteration and continue to the end of the loop

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