2.4.3 Write and interpret code that uses selection (branching) Flashcards

1
Q

Fill The Blank:

In early versions of ……….. there was no …….. statement and developers had to use …………… mapping

A

Python, Case, Dictionary

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

Define:

Dictionary

A

Iterable data structure built in to Python that contains a series of values with corresponding keys

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

State:

3 uses of iteration

A
  • Adding numbers
  • Repeating functions
  • Cycling through values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State:

Statement used to force a loop to stop (even if a condition is true)

A

break

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

State:

How to run a block of code after a for or while loop has been completed - that is not needed because it continues anyway

A

else:

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

State:

Statement used to stop the current iteration and continue with the next iteration

A

continue

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