Created
June 14, 2014 01:05
-
-
Save eidolonrage/6baaaa1eebb511fea46f to your computer and use it in GitHub Desktop.
Nathan's FizzBuzz thingy
This file contains hidden or 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
x = 1 | |
for x in range(1,101): | |
y = x%3 | |
z = x%5 | |
if y + z == 0: | |
print 'FizzBuzz' | |
else: | |
if y == 0: | |
print 'Fizz' | |
else: | |
if z == 0: | |
print 'Buzz' | |
else: | |
print x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's quite a bit happening in that one line. I split it up into a much longer version with heavy comments explaining how it works:
https://gist.github.com/sunetos/220d770a7080f9ac38c0