分享至
dict1={"香蕉":20,"蘋果":50,"草莓":60}f=input("請輸入水果:")fq=int(input("請輸入數量"))v=dict1.get(f)vt=v*fqprint("你買的水果是",f,"合計費用",vt)
為何執行以上程式會錯誤??
input("請輸入水果:")輸入 香蕉/蘋果/草莓沒錯誤
IT邦幫忙