FizzBuzz easy
loops

Write a function solution(n) that returns a list of strings for numbers 1 through n:

  • "Fizz" if divisible by 3
  • "Buzz" if divisible by 5
  • "FizzBuzz" if divisible by both
  • The number as a string otherwise

Example

solution(5) → ["1", "2", "Fizz", "4", "Buzz"]
solution(15) → [..., "FizzBuzz"]
solution.py
💡 Tip: Press Ctrl+Enter to run