Skip to content

Instantly share code, notes, and snippets.

@adammenges
Last active January 1, 2016 15:38
Show Gist options
  • Save adammenges/8165129 to your computer and use it in GitHub Desktop.
Save adammenges/8165129 to your computer and use it in GitHub Desktop.
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