面包店的小票上列着每样东西的价格。写 receipt_total(prices),返回一共多少钱。什么都没买(空列表)就是 0。
receipt_total(prices)
0
receipt_total([12, 8, 5])
25
receipt_total([])
def receipt_total(prices): # 在这里写:把所有价格加起来 return 0
写好了先点「运行」试试示例,没问题再点「提交」。
这一页要打开 JavaScript 才能写代码。