Created
January 10, 2017 16:46
-
-
Save steve-kasica/88a0561810dff27a0cff4ed541ead669 to your computer and use it in GitHub Desktop.
The Fizz Buzz Test
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
""" | |
fizz_buzz.py | |
------------------------------------ | |
My solution to the Fizz Buzz Test. | |
http://wiki.c2.com/?FizzBuzzTest | |
""" | |
def main(): | |
for i in range(1, 101): | |
if i % 15 == 0: | |
print 'fizzbuzz' | |
elif i % 3 == 0: | |
print 'fizz' | |
elif i % 5 == 0: | |
print 'buzz' | |
else: | |
print i | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment