Skip to content

Instantly share code, notes, and snippets.

@dbspringer
Created November 1, 2011 21:35
Show Gist options
  • Save dbspringer/1331992 to your computer and use it in GitHub Desktop.
Save dbspringer/1331992 to your computer and use it in GitHub Desktop.
FizzBuzz one liner
# FizzBuzz in one line (minus this comment)
print '\n'.join(['%d %s%s' % (i, 'Fizz'*(i%3==0), 'Buzz'*(i%5==0)) for i in xrange(101)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment