Created
October 5, 2012 00:09
-
-
Save oconnor663/3837259 to your computer and use it in GitHub Desktop.
fizzbuzz.py
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/python3 | |
pairs = ( | |
(3, "Fizz"), | |
(5, "Buzz"), | |
) | |
for i in range(1, 100): | |
output = "" | |
for modulus, substring in pairs: | |
if i % modulus == 0: | |
output += substring | |
print(output if output else i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment