← Python for Beginners
0 of 27 lessons done0%

Practice · Lesson 26 of 27

Practice: FizzBuzz

FizzBuzz is a classic first-round question. It checks if you can use loops, % and if/elif in the right order.

For each number from 1 to n:

  • divisible by both 3 and 5 → print FizzBuzz
  • divisible by 3 → print Fizz
  • divisible by 5 → print Buzz
  • otherwise → print the number

Order matters! Check "both 3 and 5" first. Otherwise 15 stops at the Fizz check.

Your task

Read n and print FizzBuzz from 1 to n, one per line.