Created
February 22, 2012 21:22
-
-
Save artursapek/1887404 to your computer and use it in GitHub Desktop.
fizz buzz
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
for i in range(0, 101): | |
d = {} | |
d[i % 3], d[i % 5] = 'Fizz', 'Buzz' | |
if 0 in d: | |
if len(d) == 1: | |
print 'FizzBuzz' | |
else: | |
print d[0] | |
else: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment