Skip to content
Open
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
14 changes: 14 additions & 0 deletions projects/m1/002-bottle-deposits/python/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# 1)Drink containers holding one liter or less have a $0.10 deposit, and drink containers holding more than one liter have a $0.25 deposit.
# 2)Write a program that reads the number of containers of each size from the user.
# 3)Your program should continue by computing and displaying the refund that will be received for returning those containers.
# Format the output so that it includes a dollar sign and two digits to the right of the decimal point.

Bottiglie_1 = int(input("Inserire bottiglie 1l o inferiori: "))
Bottiglie_2 = int(input("Inserire bottiglie superiori a 1l: "))

Resto_Cauzione_1 = Bottiglie_2 * 0.10
Resto_Cauzione_2 = Bottiglie_2 * 0.25
Cauzione_Totale = Resto_Cauzione_1 + Resto_Cauzione_2

print("Reso Cauzione:", (f"{Cauzione_Totale:.2f}") , "$")