127k views
3 votes
1. Write a program that asks the user for a single integer n and prints the non-negative multiples of 3 that are less than n . Here is an example run of the program on Submitty Enter a positive integer: 12

1 Answer

2 votes

Step-by-step explanation:

0

3

6

9

12

def print_multiples(n):

for i in range(n):

if i % 3 == 0 and i != 0:

print(i)

num = int(input("Enter a positive integer: "))

print_multiples(num)

User Zen Of Kursat
by
7.8k points

No related questions found