Skip to content

Instantly share code, notes, and snippets.

@oconnor663
Created October 5, 2012 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oconnor663/3837259 to your computer and use it in GitHub Desktop.
Save oconnor663/3837259 to your computer and use it in GitHub Desktop.
fizzbuzz.py
#!/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