You are on page 1of 2

MENU = {

"espresso": {
"ingredients": {
"water": 50,
"coffee": 18,
},
"cost": 1.5,
},
"latte": {
"ingredients": {
"water": 200,
"milk": 150,
"coffee": 24,
},
"cost": 2.5,
},
"cappuccino": {
"ingredients": {
"water": 250,
"milk": 100,
"coffee": 24,
},
"cost": 3.0,
}
}
resources = {
"water": 300,
"milk": 200,
"coffee": 100,
}

def make_coffee(order):
"""It will make coffee and deduct the resources from the machine"""

if order == "latte":
resources["coffee"] -= MENU[order]["ingredients"]["coffee"]
resources["milk"] -= MENU[order]["ingredients"]["milk"]
resources["water"] -= MENU[order]["ingredients"]["water"]

elif order == "espresso":


resources["water"] -= MENU[order]["ingredients"]["water"]
resources["coffee"] -= MENU[order]["ingredients"]["coffee"]
elif order == "cappuccino":
resources["coffee"] -= MENU[order]["ingredients"]["coffee"]
resources["milk"] -= MENU[order]["ingredients"]["milk"]
resources["water"] -= MENU[order]["ingredients"]["water"]

order = input("What would you like? (latte/espresso/cappuccino):


").lower()

#make_coffee(order=order)

#print(resources)

if order == "report":
for i in resources:
print(f"{i}: {resources[i]}")

You might also like