Advertisement
BlaziQ

Bottle of Beer 2.0

Apr 6th, 2020
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. bobotw = " bottles of beer on the wall"
  2. bob = " bottles of beer."
  3. take = "Take one down and pass it around, "
  4. beer = 99
  5.  
  6. def on_wall(beer):
  7.     if beer == 0:
  8.         print("No more" + bobotw + ", no more" + bob)
  9.         print("Go to the store and buy some more, 99" + bobotw + ".")
  10.         return
  11.     elif beer == 1:
  12.         print(str(beer) + " bottle of beer on the wall, " + str(beer) + " bottle of beer.")
  13.         beer -= 1
  14.         print(take + "no more" + bobotw + ".")
  15.     elif beer == 2:
  16.         print(str(beer) + bobotw + ", " + str(beer) + bob)
  17.         beer -= 1
  18.         print(take + "only one bottle of beer on the wall.")
  19.     else:
  20.         print(str(beer) + bobotw + ", " + str(beer) + bob)
  21.         beer -= 1
  22.         print(take + str(beer) + bobotw + ".")
  23.     on_wall(beer)
  24.  
  25. answer = input("Do you want to see the Bottles of Beer song? (y/n) : ")
  26.  
  27. if answer.lower() == "y":
  28.     on_wall(beer)
  29. elif answer.lower() == "n":
  30.     print("Bollocks to ya then.")
  31. else:
  32.     print("It's y for yes, n for no.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement