11智能在线
新记
Python问题,显示要求整数,但是怎么在list中加数值?
同时加string
举报该文章
相关建议 2016-09-01
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里面写的。
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/f87vpq2qf47ssvp88sq.html
其他看法
无其他回答
相似回答
大家正在搜
相关问题
python编程,把一个整数list分成两个list,要求两...
Python如何把数值放到一个数组里面
python中为什么这个list里的元素可以不用单引号吗?这...
用Python读取文件中的数字并加入list的问题
把python list中每个元素加1,有什么简洁的写法么
python类中两个列表实例如何相加或相减
python中关于list的的问题:为什么list相加之后再...
python 怎么在list中放入字符串