All exercises

FizzBuzz (Python)

CorePython

Runs entirely in your browser — your code never leaves your machine.

Problem

Return a list of strings for the numbers 1 to n: • multiples of 3 → 'Fizz' • multiples of 5 → 'Buzz' • multiples of both → 'FizzBuzz' • otherwise the number as a string fizzbuzz(5) → ['1', '2', 'Fizz', '4', 'Buzz']

Related cheat sheet
Your code
Press Run tests to check your solution.