Python问题,显示要求整数,但是怎么在list中加数值?

同时加string

def conpute_bill(food):
    total=0
    for i in food:
        if(i in price.keys()):
            total+=price[food]
        else:
            pass
    return total追问

为什么要用if else?我也没学过if里面写的。

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答