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.3 Assessment: Expressions
Subgoals for writing expressions:.
-
-
Determine operators, function calls, or method calls that will produce the value of variable
-
Decide order of operands and operators
-
Operators and operands must be compatible
-
Exercises Exercises
1.
Q1: What is the value of
beta
after the following code is executed?
alpha = 3
beta = 7
gamma = -3.5
delta = '5'
epsilon = 'numbers'
beta //= alpha
2.
Q2: Is the following code valid?
alpha = 3
beta = 7
gamma = -3.5
delta = '5'
epsilon = 'numbers'
gamma += beta
3.
Q3: What is the value of
zeta
after the following code is executed?
alpha = 3
beta = 7
gamma = -3.5
delta = '5'
epsilon = 'numbers'
zeta = epsilon or alpha
4.
Q4: What is the value of
eta
after the following code is executed?
alpha = 3
beta = 7
gamma = -3.5
delta = '5'
epsilon = 'numbers'
eta = alpha*delta
5.
Q5: What is the value of
theta
after the following code is executed?
alpha = 3
beta = 7
gamma = -3.5
delta = '5'
epsilon = 'numbers'
theta = gamma < beta + delta
You have attempted
of
activities on this page.