小明的妈妈在超市里买了一些商品,商品的价格放在列表里,现在超市对商品进行打折处理,请运行如下代码输出结果?( )
def fun(lst):
total = 0
for x in lst:
if x >= 100:
total += x * 0.5
else:
total += x
return total
goods = [140, 90, 120, 60]
print(fun(goods))
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析