Skip to content

Instantly share code, notes, and snippets.

@adammenges
Last active Jan 1, 2016
Embed
What would you like to do?
One liner FizzBuzz
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