Skip to content

Instantly share code, notes, and snippets.

@pcote
Last active January 1, 2016 19:52
Show Gist options
  • Select an option

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

Select an option

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