Solution to Write a program that prints out the lyrics to that beloved classic, that field-trip favorite: … - Sikademy

Nov. 15, 2019

Archangel Macsika Sikademy Image

Archangel Macsika

Write a program that prints out the lyrics to that beloved classic, that field-trip favorite: "99 Bottles of coke on the Wall." Lyric: 99 bottles of coke on the wall, 99 bottles of coke. Take one down and pass it around, 98 bottles of coke on the wall. ........ 1 bottle of coke on the wall, 1 bottles of coke. Take one down and pass it around, 0 bottles of coke on the wall.

Solution in Python Programming Language


for counter in reversed(range(1, 100)):
    print counter, 'bottles of coke on the wall,',counter,' bottles of coke.'
    print 'Take one down and pass it around,', counter-1,' bottles of coke on the wall.'
           

If you would like to see a different solution or an implementation in a different programming language Kindly let us know