Skip to content

Instantly share code, notes, and snippets.

@abatilo
Created October 28, 2015 16:37
Show Gist options
  • Save abatilo/7e31ecfdec905a9fd7b8 to your computer and use it in GitHub Desktop.
Save abatilo/7e31ecfdec905a9fd7b8 to your computer and use it in GitHub Desktop.
3 line implementation of fizz buzz using pythonic one liners
for i in range(1, 101):
s = "%s%s" % ('Fizz' if i % 3 == 0 else '', 'Buzz' if i % 5 == 0 else '')
print s if len(s) > 0 else i
Copy link

ghost commented Oct 28, 2015

Data center access limited to data center technicians and approved GitHub staff..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment