Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # How many bottles of beer are we starting with?
- number_of_bottles = 99
- def sing_the_song(bottles):
- # Before we start the beer drinking, the remainder is the number of bottles we have
- remaining_number_of_bottles = bottles
- # Do we have any bottles left?
- while remaining_number_of_bottles > 0:
- print (remaining_number_of_bottles, " bottles of beer on the wall, ")
- print (remaining_number_of_bottles, " bottles of beer!")
- print ("You take one down, pass it around")
- # We just drank a beer, lets do the math right away
- remaining_number_of_bottles -= 1
- print (remaining_number_of_bottles, " bottles of beer on the wall")
- print("\r\n")
- # Calling the function with the number of bottles to drink as an input
- sing_the_song(number_of_bottles)
Advertisement
Add Comment
Please, Sign In to add comment