Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python programming. Write a program with a for-loop that sings (i.e. prints) the North American road trip song, 99 Bottles of Beer (Links to an

Python programming.

Write a program with a for-loop that sings (i.e. prints) the North American road trip song, 99 Bottles of Beer (Links to an external site.)Links to an external site..

Depending on how long the road trip is, students (i.e. users), must decide how many bottles of beer to start with. So the program should ask for that input. If the user indicates that they wish to stop, the program should end with a nice message. Otherwise the program should then proceed to output lyrics from the song until there are no more bottles of beer on the wall.

sample output:

How many bottles of beer on the wall? -5 Sorry, that's not a valid number of bottles. Try again. How many bottles of beer on the wall? 5 OK, here we go! 
5 bottles of beer on the wall, 5 bottles of beer. Take one down, pass it around, 4 bottles of beer on the wall. 4 bottles of beer on the wall, 4 bottles of beer. Take one down, pass it around, 3 bottles of beer on the wall. 3 bottles of beer on the wall, 3 bottles of beer. Take one down, pass it around, 2 bottles of beer on the wall. 2 bottles of beer on the wall, 2 bottles of beer. Take one down, pass it around, 1 bottle of beer on the wall. 1 bottle of beer on the wall, 1 bottle of beer. Take it down, pass it around, no more bottles of beer on the wall! 

another sample output:

How many bottles of beer on the wall? End Goodnight, let's play again later. 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

2. How can competencies be used in employee development?

Answered: 1 week ago