FizzBuzz

Report a typo

FizzBuzz is a famous code challenge used in interviews to test basic programming skills. It's time to write your own implementation.

Print numbers from 1 to 100 inclusively following these instructions:

  • If a number is a multiple of 3, print "Fizz" instead of this number

  • If a number is a multiple of 5, print "Buzz" instead of this number

  • For numbers that are multiples of both 3 and 5, print "FizzBuzz"

  • Print the rest of the numbers unchanged.

Output each value on a separate line.

Write a program in Python 3





Create a free account to access the full topic