Question: Python Coding Question. Write a text-based program that asks for the input of a beverage, then saves the Ninety-Nine Bottles of... song to a file

Python Coding Question.

Write a text-based program that asks for the input of a beverage, then saves the "Ninety-Nine Bottles of..." song to a file with the chosen beverage. Example:

99 bottles of orange juice on the wall

99 bottles of orange juice Take one down; pass it around 98 bottles of orange juice on the wall 98 bottles of orange juice on the wall 98 bottles of orange juice Take one down; pass it around 97 bottles of orange juice on the wall 

etc., etc, etc...

2 bottles of orange juice on the wall 2 bottles of orange juice Take one down; pass it around 1 bottle of orange juice on the wall 1 bottle of orange juice on the wall 1 bottle of orange juice Take one down; pass it around No more bottles of orange juice on the wall! 

Note that the last two verses are different from the others (in pluralization and the very last line of the song) the easiest way to handle this is to stop your loop after the third-from-last verse and print the last two separately. Tip: use the three-parameter form of range().

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!