[Solved] 99 Bottles of Beer

$25

File Name: 99_Bottles_of_Beer.zip
File Size: 169.56 KB

SKU: [Solved] 99 Bottles of Beer Category: Tag:
5/5 - (1 vote)

https://www.youtube.com/playlist?list=PLhOuww6rJJNNGDXdGGfp3RDXBMhJwj0Ij

Write a song that will generate the verses to the song 99 Bottles of Beer:

$ ./bottles.py | tail2 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 one down, pass it around,No more bottles of beer on the wall!

If given a -n or --num argument, generate the verses from that number down to 0:

$ ./bottles.py -n 22 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 one down, pass it around,No more bottles of beer on the wall!

The program should respond to -h and --help with a usage:

$ ./bottles.py -husage: bottles.py [-h] [-n int]Bottles of beer songoptional arguments:  -h, --help         show this help message and exit  -n int, --num int  How many bottles (default: 10)

Run the test suite to ensure your program is correct:

$ make testpytest -xv test.py============================= test session starts ==============================...collected 8 itemstest.py::test_exists PASSED                                              [ 12%]test.py::test_usage PASSED                                               [ 25%]test.py::test_bad_int PASSED                                             [ 37%]test.py::test_float PASSED                                               [ 50%]test.py::test_str PASSED                                                 [ 62%]test.py::test_one PASSED                                                 [ 75%]test.py::test_two PASSED                                                 [ 87%]test.py::test_random PASSED                                              [100%]============================== 8 passed in 0.91s ===============================

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] 99 Bottles of Beer
$25