diff --git a/exercises/19-Bottles-Of-Milk/solution.hide.py b/exercises/19-Bottles-Of-Milk/solution.hide.py index 658f18fc..074a8f10 100644 --- a/exercises/19-Bottles-Of-Milk/solution.hide.py +++ b/exercises/19-Bottles-Of-Milk/solution.hide.py @@ -1,10 +1,10 @@ # ✅↓ Write your code here ↓✅ def number_of_bottles(): for x in range(99,2,-1): - print(str(x) + " bottles of milk on the wall, " + str(x) + " bottles of milk. Take one down and pass it around, " + str(x-1)+ " bottles of milk on the wall.") - print("2 bottles of milk on the wall, 2 bottles of milk. Take one down and pass it around, 1 bottle of milk on the wall.") - print("1 bottle of milk on the wall, 1 bottle of milk. Take one down and pass it around, no more bottles of milk on the wall.") - print("No more bottles of milk on the wall, no more bottles of milk. Go to the store and buy some more, 99 bottles of milk on the wall.") + print(str(x) + " bottles of milk on the wall, " + str(x) + " bottles of milk.\nTake one down and pass it around, " + str(x-1)+ " bottles of milk on the wall.") + print("2 bottles of milk on the wall, 2 bottles of milk.\nTake one down and pass it around, 1 bottle of milk on the wall.") + print("1 bottle of milk on the wall, 1 bottle of milk.\nTake one down and pass it around, no more bottles of milk on the wall.") + print("No more bottles of milk on the wall, no more bottles of milk.\nGo to the store and buy some more, 99 bottles of milk on the wall.") return None -number_of_bottles() +number_of_bottles() \ No newline at end of file diff --git a/exercises/19-Bottles-Of-Milk/test.py b/exercises/19-Bottles-Of-Milk/test.py index 70af0ca9..542a025a 100644 --- a/exercises/19-Bottles-Of-Milk/test.py +++ b/exercises/19-Bottles-Of-Milk/test.py @@ -32,13 +32,13 @@ def test_for_function_output(capsys): text='' for x in range(99,-1,-1): if (x==0): - text+=("No more bottles of milk on the wall, no more bottles of milk. Go to the store and buy some more, 99 bottles of milk on the wall.\n") + text+=("No more bottles of milk on the wall, no more bottles of milk.\nGo to the store and buy some more, 99 bottles of milk on the wall.\n") elif (x==1): - text+=("1 bottle of milk on the wall, 1 bottle of milk. Take one down and pass it around, no more bottles of milk on the wall.\n") + text+=("1 bottle of milk on the wall, 1 bottle of milk.\nTake one down and pass it around, no more bottles of milk on the wall.\n") elif (x==2): - text+=("2 bottles of milk on the wall, 2 bottles of milk. Take one down and pass it around, 1 bottle of milk on the wall.\n") + text+=("2 bottles of milk on the wall, 2 bottles of milk.\nTake one down and pass it around, 1 bottle of milk on the wall.\n") else: - text+=(str(x) + " bottles of milk on the wall, " + str(x) + " bottles of milk. Take one down and pass it around, " + str(x-1)+ " bottles of milk on the wall.\n") + text+=(str(x) + " bottles of milk on the wall, " + str(x) + " bottles of milk.\nTake one down and pass it around, " + str(x-1)+ " bottles of milk on the wall.\n") assert captured.out == text