Commit 6df3fedb by BellCodeEditor

auto save

parent 41eb8325
Showing with 9 additions and 2 deletions
...@@ -13,5 +13,12 @@ def new_input(): ...@@ -13,5 +13,12 @@ def new_input():
total.append(unit) total.append(unit)
finally: finally:
print("-"*30) print("-"*30)
return total
def sum(unit):
c=0
for i in unit:
c=c+i
return c
r=new_input() r=new_input()
print(r) pay = sum(r)
\ No newline at end of file print("一共消费了"+str(pay)+"元")
\ No newline at end of file
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