Skip to content

Instantly share code, notes, and snippets.

@pcote
Last active February 21, 2017 20:52
Show Gist options
  • Select an option

  • Save pcote/dfe3dd4a652f6fe9cbec to your computer and use it in GitHub Desktop.

Select an option

Save pcote/dfe3dd4a652f6fe9cbec to your computer and use it in GitHub Desktop.
def fizzbuzz12(maxnum):
type("", (), {"__call__": staticmethod(lambda mn: print(
"\n".join("{:2}: {}".format(num,
(lambda n: ("" if n % 3 else "fizz") +
("" if n % 5 else "buzz") )(num))
for num in range(1, mn + 1))))})()(maxnum)
fizzbuzz12(50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment