Skip to content

Instantly share code, notes, and snippets.

@mpurdon
Created March 18, 2015 17:47
Show Gist options
  • Save mpurdon/13d8896ff190edee60f8 to your computer and use it in GitHub Desktop.
Save mpurdon/13d8896ff190edee60f8 to your computer and use it in GitHub Desktop.
Pythonic BizzFuzzes
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