Last active
December 30, 2015 06:49
-
-
Save stevenrich-zz/7792321 to your computer and use it in GitHub Desktop.
99 bottles of beer on the wall.
This file contains 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
Thanks to Gist, I can embed pieces of code in my blog like this one, | |
which iterates the lyrics to the song, "99 bottles of beer" in time: | |
import time | |
x = 99 | |
beer = " bottles of beer" | |
wall = " on the wall" | |
take = "take one down" | |
passit = "pass it around" | |
while x>0: | |
print str(x) + beer + wall | |
time.sleep(2) | |
print str(x) + beer | |
time.sleep(2) | |
print take | |
time.sleep(1) | |
print passit | |
time.sleep(1) | |
x = x-1 | |
print str(x) + beer + wall | |
time.sleep(2) | |
print "You are out of beer. :(" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment