Aug-20-2022, 06:08 PM
Hey everyone.
I keep getting the error "Function no scriptable". I don't know why.
from tkinter import Menu
I keep getting the error "Function no scriptable". I don't know why.
from tkinter import Menu
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,
}
}
profit = 0
resources = {
"water": 0,
"milk": 0,
"coffee": 0,
"money": 0.00
}
def checkr(drink):
make_drink = True
if resources["water"] < MENU[choice]["ingredients"]["water"]:
print("There is not enough water")
make_drink = False
if resources["milk"] < MENU[choice]["ingredients"]["milk"]:
print("There is not enough milk")
make_drink = False
if resources["coffee"] < MENU[choice]["ingredients"]["coffee"]:
print("There is not enough coffee grounds")
make_drink = False
return make_drink
is_on = True
while is_on:
choice = input("What would you like? (espresso/latte/cappuccino): ")
if choice == "off":
is_on = False
if choice == "report":
print(f"Water: {resources['water']} ml")
print(f"Milk: {resources['milk']} ml")
print(f"Coffee: {resources['coffee']} ml")
print(f"Money: ${resources['money']}")
if choice == "latte" or choice == "espresso" or choice == "cappuccino":
if checkr[choice] == True:
print("Drink Made")
