From 535afbd80e0d9705e247743806bf44c47fae2321 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 18 Sep 2022 09:44:24 +0800 Subject: [PATCH] save project --- 1.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/1.py b/1.py index aebd84a..9cdcef6 100644 --- a/1.py +++ b/1.py @@ -13,9 +13,12 @@ def new_input(): total.append(money) finally: print("-"*30) - def sum(money): - count=0 - for i in money: - count=count+1 - return count - print("你一共消费"+str(count)+"现金还是扫码") \ No newline at end of file + return total +def sum(money): + count=0 + for i in money: + count=count+i + return count +price=new_input() +pay=sum(price) +print("您一共消费"+str(pay)+"元 扫码还是现金") \ No newline at end of file -- libgit2 0.25.0