← All challenges
✓ Solved
FizzBuzz
The classic. Print numbers 1-15, but with a twist on multiples of 3 and 5.
🟢 EasyDifficulty
The challenge
Print the numbers from 1 to 15, one per line -- except:
- For multiples of 3, print
Fizzinstead of the number - For multiples of 5, print
Buzzinstead of the number - For multiples of both 3 and 5, print
FizzBuzz
🧠 Need a hint? (Python)
The modulo operator (%) tells you if a number divides evenly. Check i % 15 == 0 before checking i % 3 or i % 5 alone, or the FizzBuzz case will never be reached.
🚀
Like solving these?
Structured courses, hands-on exercises, and real multi-file projects are waiting -- your first project unlock is free.
Create a free account