Last active
January 1, 2016 15:38
-
-
Save adammenges/8165129 to your computer and use it in GitHub Desktop.
One liner FizzBuzz
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
def fizzbuzz(n): | |
print "\n".join([('Fizz'*(not i%3) + 'Buzz'*(not i%5)) if ((not i%3) or (not i%5)) else str(i) for i in xrange(1, n+1)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment