Created
April 30, 2010 19:33
-
-
Save zachelko/385656 to your computer and use it in GitHub Desktop.
FizzBuzz
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
# Zach J. Elko | |
# | |
# Solution for the programming question listed here: | |
# http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html | |
# | |
for i in range(1, 101): | |
multipleOf3 = (i % 3 == 0) | |
multipleOf5 = (i % 5 == 0) | |
if multipleOf3 and multipleOf5: | |
print 'FIZZBUZZ' | |
elif multipleOf3: | |
print 'FIZZ' | |
elif multipleOf5: | |
print 'BUZZ' | |
else: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment