Skip to content

Instantly share code, notes, and snippets.

@eprislac
Last active February 22, 2019 08:27
Show Gist options
  • Save eprislac/d9a2cc77c2ef98286c027f5e2fe23a74 to your computer and use it in GitHub Desktop.
Save eprislac/d9a2cc77c2ef98286c027f5e2fe23a74 to your computer and use it in GitHub Desktop.
from functools import reduce
def fizzbuzziness(num):
tbl = { 'Fizz': num % 3 == 0, 'Buzz': num % 5 == 0 }
trues = { k: v for k, v in tbl.items() if v }
return reduce((lambda x, y: x + y), list(trues.keys()), '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment