Commit 535afbd8 by BellCodeEditor

save project

parent bcb807a3
Showing with 10 additions and 7 deletions
...@@ -13,9 +13,12 @@ def new_input(): ...@@ -13,9 +13,12 @@ def new_input():
total.append(money) total.append(money)
finally: finally:
print("-"*30) print("-"*30)
def sum(money): return total
count=0 def sum(money):
for i in money: count=0
count=count+1 for i in money:
return count count=count+i
print("你一共消费"+str(count)+"现金还是扫码") return count
\ No newline at end of file price=new_input()
pay=sum(price)
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