Skip to content

Instantly share code, notes, and snippets.

@steve-kasica
Created January 10, 2017 16:46
Show Gist options
  • Save steve-kasica/88a0561810dff27a0cff4ed541ead669 to your computer and use it in GitHub Desktop.
Save steve-kasica/88a0561810dff27a0cff4ed541ead669 to your computer and use it in GitHub Desktop.
The Fizz Buzz Test
"""
fizz_buzz.py
------------------------------------
My solution to the Fizz Buzz Test.
http://wiki.c2.com/?FizzBuzzTest
"""
def main():
for i in range(1, 101):
if i % 15 == 0:
print 'fizzbuzz'
elif i % 3 == 0:
print 'fizz'
elif i % 5 == 0:
print 'buzz'
else:
print i
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment