SQLDAXExcelPython
Leaderboard
Core PythonEasy10 points

FizzBuzz

Complete fizzbuzz(n) so it returns a list for 1 to n: Fizz for multiples of 3, Buzz for multiples of 5, FizzBuzz for both, and the number itself otherwise.

How your answer is tested

After your code, this runs and its result is checked:

result = fizzbuzz(15)
Show solutionLifetime

Real Python running in your browser through Pyodide, with pandas available. Nothing you type is sent to a server unless you save a score.

Python
Loading editor…

Press Ctrl+Enter or Run to see the result here.