All projects
Beginner+60 XP

FizzBuzz

Loop from 1 to 20. Print Fizz for multiples of 3, Buzz for multiples of 5, FizzBuzz for multiples of both, and the number otherwise. A rite of passage that drills loops, conditionals, and the modulo operator.

Requirements

  • 1

    Loop through the numbers 1 to 20

  • 2

    Print 'Fizz' for multiples of 3 and 'Buzz' for multiples of 5

  • 3

    Print 'FizzBuzz' when divisible by both, otherwise the number

Build it here — edit the starter code and hit Run:

fizzbuzz.py · editable