Icon for Fizz Buzz in Python

Fizz Buzz in Python

2009 1 min read PDF Markdown

Jeff Atwood of Coding Horror has developed a sure fire test to filter out good programmers from bad ones. It's called the FizzBuzz test, and it's a very simple problem to solve.

for i in range(1, 101):
    if not i % 15:
        print "FizzBuzz"
    elif not i % 3:
        print "Fizz"
    elif not i % 5:
        print "Buzz"
    else:
        print i