Skip to content

Instantly share code, notes, and snippets.

@stevenrich-zz
Last active December 30, 2015 06:49
Show Gist options
  • Save stevenrich-zz/7792321 to your computer and use it in GitHub Desktop.
Save stevenrich-zz/7792321 to your computer and use it in GitHub Desktop.
99 bottles of beer on the wall.
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