4.10. Glossary¶
- Body¶
The sequence of statements within a compound statement.
- Boolean Expression¶
An expression whose value is either
True
orFalse
.- Branch¶
One of the alternative sequences of statements in a conditional statement.
- Chained Conditional¶
A conditional statement with a series of alternative branches.
- Comparison Operator¶
One of the operators that compares its operands:
==
,!=
,>
,<
,>=
, and<=
.- Conditional Statement¶
A statement that controls the flow of execution depending on some condition.
- Condition¶
The boolean expression in a conditional statement that determines which branch is executed.
- Compound Statement¶
A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header.
- Guardian Pattern¶
Where we construct a logical expression with additional comparisons to take advantage of the short-circuit behavior.
- Logical Operator¶
One of the operators that combines boolean expressions:
and
,or
, andnot
.- Nested Conditional¶
A conditional statement that appears in one of the branches of another conditional statement.
- Traceback¶
A list of the functions that are executing, printed when an exception occurs.
- Short Circuit¶
When Python is part-way through evaluating a logical expression and stops the evaluation because Python knows the final value for the expression without needing to evaluate the rest of the expression.
-
Q-1: Match each term with its definition.
Look above for these terms.
- body
- The sequence of statements within a compound statement.
- branch
- One of the alternative sequences of statements in a conditional statement.
- guardian pattern
- Where we construct a logical expression with additional comparisons to take advantage of the short-circuit behavior.
- short circuit
- When Python is part-way through evaluating a logical expression and stops the evaluation because Python knows the final value for the expression without needing to evaluate the rest of the expression.
Before you keep reading...
Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.
-
Q-2: Match each term with its definition.
Look above for these terms.
- boolean expression
- An expression whose value is either
True or False . - comparison operator
- One of the operators that compares its operands:
== , != , > , < , >= , and <= . - logical operator
- One of the operators that combines boolean expressions:
and , or , and not . - traceback
- A list of the functions that are executing, printed when an exception occurs.
-
Q-3: Match each term with its definition.
Look above for these terms.
- chained conditional
- A conditional statement with a series of alternative branches.
- conditional statement
- A statement that controls the flow of execution depending on some condition.
- condition
- The boolean expression in a conditional statement that determines which branch is executed.
- compound statement
- A statement that consists of a header and a body.
- nested conditional
- A conditional statement that appears in one of the branches of another conditional statement.