Wenn Sie eine Liste haben und der Benutzer einen der Schlüssel eingibt, geben Sie den Wert aus

# here is a list of food and its Calories 
list ={
    "Apple": "130",
    "Avocado": "50",
}
# get the key from user and print its value
try:
    item = str(input("Item: "))
    print(list[f"{item}"])
except KeyError:
    pass
Inquisitive Ibex