Answers for "Write a program that prints the numbers from 1 to 100 and for multiples of ‘3’ print “Fizz” instead of the number and for the multiples of ‘5’ print “Buzz”"

2

Write a Python program which iterates the integers from 1 to 50. For multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz"

for x in range(100):
  output = ""
  if x % 3 == 0:
    output += "Fizz"
  if x % 5 == 0:
    output += "Buzz"
  print(output)
Posted by: Guest on January-05-2020

Code answers related to "Write a program that prints the numbers from 1 to 100 and for multiples of ‘3’ print “Fizz” instead of the number and for the multiples of ‘5’ print “Buzz”"

Python Answers by Framework

Browse Popular Code Answers by Language