Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Not Use "if else"
from __future__ import print_function
join = getattr("", "join")
_buzz = lambda x: "Buzz" * (not (x % 3))
__fizz = lambda x: "Fizz" * (not (x % 5))
buzz = lambda x: [x, _buzz(x)]
_fizzbuzz = lambda x, buzz: __fizz(x) + buzz
_fizz = lambda num, buzz: (str(num) * (not (_fizzbuzz(num, buzz))))
fizz = lambda x: _fizz(*x) + _fizzbuzz(*x)
[print(fizz(buzz(x))) for x in range(1, 100)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.