Writing a Song

Tony wants to print out the full lyrics to the song "99 Bottles of Beer on the Wall," so he's written the code below. The song is supposed to involve taking down each of the 99 bottles in turn and passing them around until all the bottles have been taken down and passed around.

1
2
3
4
5
6
7
8
9
number = 99
while number > 1:
# each loop prints one verse of the song
    print `number` + " bottles of beer on the wall." 
    print `number` + " bottles of beer on the wall." 
    print "Take one down; pass it around." 
    number = number - 1
    print `number` + " bottles of beer on the wall." 
    print " "

What is wrong with his lyrics?

Image Credit: Darien Graham-Smith
×

Problem Loading...

Note Loading...

Set Loading...