如果我有一个字典,并且想要打印出特定键的值,我该如何在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