Skip to content

Instantly share code, notes, and snippets.

@ericdorsey
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericdorsey/075cb013ca1e28d591a1 to your computer and use it in GitHub Desktop.
Save ericdorsey/075cb013ca1e28d591a1 to your computer and use it in GitHub Desktop.
FizzBuzz in Python
#From http://blog.codinghorror.com/why-cant-programmers-program/
def FizzBuzz():
for i in range(1,100):
if ((i % 3 == 0) and (i % 5 == 0)):
print "FizzBuzz"
elif (i % 3 == 0):
print "Fizz"
elif (i % 5 == 0):
print "Buzz"
else:
print i
FizzBuzz()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment