Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: UTF-8 -*-
- #!C:\Python\python.exe
- ##
- ## NOTE:
- ## Python 2.x/3.x compatible
- ## Your bang path on Windows may vary (depending on where you installed your Python 2.x/3.x binaries).
- ##
- ####
- ## [99_bottles_py.cgi]
- ##
- ## 99 Bottles Of Beer Lyrics.
- ##
- ## (c) Damion 'Phr0z3n.dev' Tapper, 2014.
- ## Email: Phr0z3n.Dev@Gmail.com
- ####
- print("Content-Type: text/plain; charset=utf-8\n");
- # To print text/html output, change the new line character from '\n' to '<br />'
- print(">>------------------> 99 Bottles Of Beer Lyrics <------------------<<\n")
- bottles_of_beer = 99
- beer_buffer = ""
- while bottles_of_beer:
- beer_buffer = "{0} bottle{1}".format(bottles_of_beer, "s" if bottles_of_beer != 1 else "") +\
- " of beer on the wall, {0} bottle{1}".format(bottles_of_beer, "s" if bottles_of_beer != 1 else "") + " of beer." +\
- "\nTake one down and pass it around, " +\
- "{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 "") +\
- " of beer on the wall.\n"
- print(beer_buffer)
- bottles_of_beer -= 1
- print("No more bottles of beer on the wall, no more bottles of beer.")
- print("Go to the store and buy some more, 99 bottles of beer on the wall\n")
- print(">>-------------------------------> + <-------------------------------<<")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement