Skip to content

Instantly share code, notes, and snippets.

@starenka starenka/bottles.py
Last active Dec 21, 2015

Embed
What would you like to do?
'''
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.
...
1 bottle of beer on the wall, 1 bottle of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
'''
starenka /prac/python/codegolf % ./bottles.py
================= func: [ beatme ], len: 196 =================
i=99;p=lambda:`i or 99`+' bottle'+'s of beer on the wall'[i==1:]
while i:r=p();i-=1;print"%s, %s.\n"*2%(r,r[:-12],'Take one down and pass it around'if i else'Go to the store and buy some more',p())
===============================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.