Skip to main content\(
\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.3 Complete the Code
Checkpoint 16.3.1.
Complete the code to print numbers 1 through 10 using a while loop.
num = ___
while num <= ___:
print(num)
num += ___
Checkpoint 16.3.2.
Complete the code to print only even numbers from 1 to 20 using a for loop.
for i in range(1, 21):
if i % ___ == ___:
print(i)
Checkpoint 16.3.3.
Complete the code to print only even numbers from 1 to 20 using a for loop.
numbers = [4, 12, 7, 15, 9, 20]
count = 0
for num in numbers:
if num ___ 10:
count += 1
print(count)
You have attempted
of
activities on this page.