70.5k views
1 vote
4.3 Code Practice: Question 2

Write a program that uses a while loop to calculate and print the multiples of 3 from 3 to 21. Your program should print each number on a separate line.

(Python)

1 Answer

1 vote

i = 3

while i <= 21:

if i % 3 == 0:

print(i)

i += 1

User Ppasler
by
5.8k points