Skip to content

Write a program that prints the numbers from 1 to 100. But for multiples of 3, print "Fizz" instead of the number, and for multiples of 5, print "Buzz". For numbers which are multiples of both 3 and 5, print "FizzBuzz". #148587

Discussion options

You must be logged in to vote

here is the answer

for i in range(1, 101):
if i % 3 == 0 and i % 5 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
        print(i)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tawseef123
Comment options

Answer selected by tawseef123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Programming Help Programming languages, open source, and software development.
2 participants