Commit 0c4ef9b6 by BellCodeEditor

save project

parent bcc9d2ad
Showing with 14 additions and 3 deletions
def ab():
total = []
total = [] #保存价格
while True:
unit=input("请输入(q退出):")
if unit =="q":
break
......@@ -14,6 +13,18 @@ def ab():
total.append(unit)
finally:
print("-"*30)
return total
return total #返回价格列表
result=ab()
print(result)
def sum(money):
cont=0
for i in money:
cont+=i
return cont
print(sum(result))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment