Commit 13b1d992 by BellCodeEditor

save project

parent a4f2738e
Showing with 9 additions and 4 deletions
def wdsj(): def wdsj():
total = [] total=[]
while True: while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
...@@ -13,5 +13,11 @@ def wdsj(): ...@@ -13,5 +13,11 @@ def wdsj():
total.append(unit) total.append(unit)
print("-"*25) print("-"*25)
return total return total
a=wdsj() def sum(huanyimo):
print(a) count=0
\ No newline at end of file for i in huanyimo:
count+=i
return count
price=wdsj()
pay=sum(price)
print("消费"+str(pay)+"元")
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