Skip to content

Instantly share code, notes, and snippets.

@esehara
Forked from chomy/lambda_fizzbuzz.py
Last active December 21, 2015 16:18
Show Gist options
  • Save esehara/6332209 to your computer and use it in GitHub Desktop.
Save esehara/6332209 to your computer and use it in GitHub Desktop.
Bug Fix :)
#!/usr/bin/python
buzz = lambda x: [(lambda _x: "" if _x % 5 else "Buzz")(x), x]
fizz = lambda x: (
(
(lambda _x: "" if _x % 3 else "Fizz")(x[1])
+ x[0])
if (x[0] or not (x[1] % 3)) else x[1])
for i in range(1, 100):
print fizz(buzz(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment