Created
March 18, 2015 17:47
-
-
Save mpurdon/13d8896ff190edee60f8 to your computer and use it in GitHub Desktop.
Pythonic BizzFuzzes
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
if __name__ == '__main__': | |
numbers = [1, 3, 5, 15, 17, 99, 100, 210, 217] | |
for number in numbers: | |
print 'Bizz'*(number%3==0) + 'Fuzz'*(number%5==0) or number | |
print '--' | |
BIZZ_FUZZ = {3: 'Bizz', 5: 'Fuzz'} | |
for number in numbers: | |
print ''.join(BIZZ_FUZZ[modded_by] for modded_by in BIZZ_FUZZ if number%modded_by==0) or number | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment