Advertisement
Phr0zen_Penguin

99 Bottles Of Beer

Sep 19th, 2014
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. #!C:\Python\python.exe
  4. ##
  5. ## NOTE:
  6. ## Python 2.x/3.x compatible
  7. ## Your bang path on Windows may vary (depending on where you installed your Python 2.x/3.x binaries).
  8. ##
  9. ####
  10. ## [99_bottles_py.cgi]
  11. ##
  12. ## 99 Bottles Of Beer Lyrics.
  13. ##
  14. ## (c) Damion 'Phr0z3n.dev' Tapper, 2014.
  15. ## Email: Phr0z3n.Dev@Gmail.com
  16. ####
  17.  
  18. print("Content-Type: text/plain; charset=utf-8\n");
  19. # To print text/html output, change the new line character from '\n' to '<br />'
  20.  
  21. print(">>------------------> 99 Bottles Of Beer Lyrics <------------------<<\n")
  22.  
  23. bottles_of_beer = 99
  24. beer_buffer = ""
  25.  
  26. while bottles_of_beer:
  27.     beer_buffer = "{0} bottle{1}".format(bottles_of_beer, "s" if bottles_of_beer != 1 else "") +\
  28.     " of beer on the wall, {0} bottle{1}".format(bottles_of_beer, "s" if bottles_of_beer != 1 else "") + " of beer." +\
  29.     "\nTake one down and pass it around, " +\
  30.     "{0} bottle{1}".format((bottles_of_beer - 1) if ((bottles_of_beer -1) != 0) else "no more", "s" if (bottles_of_beer - 1) != 1 else "") +\
  31.     " of beer on the wall.\n"
  32.  
  33.     print(beer_buffer)
  34.     bottles_of_beer -= 1
  35.  
  36. print("No more bottles of beer on the wall, no more bottles of beer.")
  37. print("Go to the store and buy some more, 99 bottles of beer on the wall\n")
  38.  
  39. print(">>-------------------------------> + <-------------------------------<<")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement