Skip to content

arreglo Bug: 19-Bottles-Of-Milk #1484 #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions exercises/19-Bottles-Of-Milk/solution.hide.py
Original file line number Diff line number Diff line change
@@ -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()
8 changes: 4 additions & 4 deletions exercises/19-Bottles-Of-Milk/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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