Control flow Flashcards

1
Q

while statement

A

Used for repeated execution as long as an expression is true

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

if statement

A

Used for conditional execution

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

for statement

A

Used to iterate over the elements of a sequence.

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

try statement

A

Specifies exception handlers and/or cleanup code for a group of statements.

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

with statement

A

Used to wrap the execution of a block with methods defined by a context manager.

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

match statement

A

Used for pattern matching.

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

break statement

A

Breaks out of the innermost enclosing for or while loop.

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

range()

A

Iterates over a sequence of numbers

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

continue statement

A

Returns the control to the beginning of the while or for loop.

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

else clause

A

catches anything which isn’t caught by the preceding conditions

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

elif clause

A

If the previous conditions were not true, then try this condition.

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

pass statement

A

Does nothing. It can be used when a statement is required syntactically but the program requires no action.

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

match statement

A

Takes an expression and compares its value to successive patterns given as one or more case blocks.

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

functions

A

A block of code that only runs when it is called.

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