Last active
August 29, 2015 14:22
-
-
Save rlfrahm/90c6ce08214d9d38518b to your computer and use it in GitHub Desktop.
A quick Python implementation of Fizzbuzz (http://en.wikipedia.org/wiki/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
#!/usr/bin/python | |
for i in range(0,100): | |
three = i % 3 | |
five = i % 5 | |
if three == 0 and five == 0: | |
print 'fizzbuzz' | |
elif three == 0: | |
print 'fizz' | |
elif five == 0: | |
print 'buzz' | |
else: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment