Skip to content

Instantly share code, notes, and snippets.

@takinbo
Created October 24, 2010 16:13
Show Gist options
  • Save takinbo/643641 to your computer and use it in GitHub Desktop.
Save takinbo/643641 to your computer and use it in GitHub Desktop.
# FizzBuzz
# ----------------------------------------------------------------------------
# in response to Pascal Ehigie Aito's blog post
# http://aitoehigie.wordpress.com/2010/10/24/most-programmers-cant-solve-this/
# here's an attempt to solve it
for i in range(1, 101):
if not (i % 3 or i % 5):
print "FizzBuzz"
elif not i % 3:
print "Fizz"
elif not i % 5:
print "Buzz"
else:
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment