Created
September 13, 2017 20:08
-
-
Save smcl/e5c9c6a48e8c5d0732c9c9311f44e7d4 to your computer and use it in GitHub Desktop.
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 | |
import sys | |
upto = int(sys.argv[1]) | |
stringsForModulus = { | |
3: "fizz", | |
5: "buzz", | |
7: "bazz" | |
} | |
for i in xrange(1, upto): | |
outputs = [ stringsForModulus[m] for m in stringsForModulus.keys() if n % m == 0 ] | |
if outputs: | |
print("".join(output)) | |
else: | |
print(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment