Skip to main content

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.