← All practice pages

Python

Python Loops & Iteration

Loops repeat work without repeating code. A for loop walks through a sequence; a while loop keeps going until its condition stops being true.

Try it now

Write a function "fizzbuzz" that takes n and returns a list of strings: "Fizz" for multiples of 3, "Buzz" for 5, "FizzBuzz" for both, or the number as string.

Create a free account to run your answer and get ARIA's review.