Last active
August 29, 2015 14:04
-
-
Save ericdorsey/075cb013ca1e28d591a1 to your computer and use it in GitHub Desktop.
FizzBuzz in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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