Skip to main content
Contents
Dark Mode Prev Up Next Scratch ActiveCode Profile
\(
\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 16.7 Review - Expressions
Practice evaluating arithmetic and string expressions and understanding operator behavior.
Subsection 16.7.1 Part A: Recognize
Checkpoint 16.7.1 .
Find the value of each expression.
3 + 4 * 2
(3 + 4) * 2
10 // 3
10 % 3
"Hi" + "!"
"ha" * 3
Subsection 16.7.2 Part B: Trace
Checkpoint 16.7.2 .
price = 20
quantity = 3
name = "Pen"
Determine the result of each expression:
price * quantity :
price + 5 :
name + "s" :
name + "s" :
quantity - 1 :
(price * quantity) + 2 :
Subsection 16.7.3 Part C: Fix
Checkpoint 16.7.3 .
"Hello" + 5
10 / / 2
"ha" + "ha" + 3
(4 + 2 * 3
Subsection 16.7.4 Part D: Create
Checkpoint 16.7.4 .
Write an expression for the total cost, an expression that creates βappleappleβ, an expression for half the total cost, and an expression that gives the remainder when
count is divided by
3.
Subsection 16.7.5 Think About ...
Checkpoint 16.7.5 .
Why does using parentheses sometimes change the result of an expression?
You have attempted
of
activities on this page.