我想知道如果我有一本字典并且只想打印出特定键的值,我在 Python 中会做什么。
它将在一个变量中以及:
dict = {'Lemonade':["1", "45", "87"], 'Coke:["23", "9", "23"] 'Water':["98", "2", "127"}
inp = input("Select key to print value for!" + "/r>>> ")
if inp in dict:
#Here is where I would like it to print the Value list for the key that is entered.
我正在运行 Python 3.3