3.G: Conditional Execution (Glossary)
- Page ID
- 3032
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)
- 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.