Skip to content

Instantly share code, notes, and snippets.

@smcl
Created September 13, 2017 20:08
Show Gist options
  • Save smcl/e5c9c6a48e8c5d0732c9c9311f44e7d4 to your computer and use it in GitHub Desktop.
Save smcl/e5c9c6a48e8c5d0732c9c9311f44e7d4 to your computer and use it in GitHub Desktop.
#!/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