Last active
December 21, 2015 09:38
-
-
Save starenka/6285995 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ''' | |
| 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