Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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