3: Conditional Execution Flashcards

0
Q

What is a Boolean expression?

A

An expression whose value is either True or False.

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

What is the body?

A

The sequence of statements within a compound statement.

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

Define branch…

A

One of the alternative sequences of statements in a conditional statement.

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

What is a chained conditional?

A

A conditional statement with a series of alternative branches.

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

What is a comparison operator?

A

One of the operators that compares it’s operands: ==, !==, , >=, and <=.

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

What is a conditional statement?

A

A statement that controls the flow of execution depending on some condition.

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

What is a condition?

A

The Boolean expression in a conditional statement that determines which branch executed.

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

What is a compound statement?

A

A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header.

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

What is a guardian pattern?

A

Where we construct a logical expression with additional comparisons to take advantage of the short circuit behavior.

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

What is logical operator?

A

One of the operators that combines Boolean expressions: and, or, and not.

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

What is a nested conditional?

A

A conditional statement that appears in one of the branches of another conditional statement.

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

What is a trace back?

A

A list of functions that are executing, printed when an exception occurs.

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

What is a short circuit?

A

When Python is part-way through evaluating a logical expression because Python knows the final value for the expression without needing to evaluate the rest of the expression.

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