我有一本字典,像這樣,從用戶輸入打印值
replies = {'0':'Leave it out to dry for 24 hours, if it does not work see customer service',
'1':'Go to a repair store to get it fixed',
'2':'Charge the phone battery',
'3':'Try resetting the phone',
'4':'Check to see if something blocking the audio jack or the speakers',
}
我有int(input(,
,我希望用戶輸入一個數字,從字典打印出來的價值,我想print(replies[number the user input])
但它不工作,任何幫助表示讚賞,也不是我不是很有經驗,所以簡單有幫助,謝謝
print(回覆[str(數字用戶輸入)]) –