Created
October 28, 2015 16:37
-
-
Save abatilo/7e31ecfdec905a9fd7b8 to your computer and use it in GitHub Desktop.
3 line implementation of fizz buzz using pythonic one liners
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Data center access limited to data center technicians and approved GitHub staff..