Why this code gives me typeError? And how can I call a dictionary using varible X? "TypeError: string indices must be integers" I print "espresso" in input. Thanks
machine = {"Water": 300, "Milk": 200, "Coffe": 100,}
espresso = {"Water": 50, "Milk": 0, "Coffe": 28,}
def check(x):
z = machine["Water"] >= x["Water"]
print(z)
x = input()
check(x)