Skip to main content\(\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\Q}{\mathbb Q}
\newcommand{\R}{\mathbb R}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 3.2 Evaluate Conditionals-WE1-P1
Subgoals for Evaluating Selection Statements.
Diagram which statements go together by indentation
-
For conditional, determine whether expression is true
If true, follow true branch
If false, follow next elif/else branch or exit conditional if no else branch
Repeat step 2 as necessary
Subsection 3.2.1 Conditionals-WE1-P1
Each question below is independent, but they all use this given setup
alpha = 2
beta = 1
delta = 3
eta = 0
gamma = 0
omega = 2.5
theta = -1.3
kappa = 3.0
Exercises Exercises
1.
2.
3.
4.
5.
Q5: Click on the statements belonging to the if-branch in the following code
if kappa < delta:
eta = 42
beta = 22
6.
Q6: Click on the statements belonging to the second if-branch (if eta > delta:
) in the following code
if gamma == eta:
eta = eta + 5
if eta > delta:
delta = 10
theta = delta + 2
alpha = 2
beta = 4
You have attempted
of
activities on this page.