From d3d18751905b393bb76467885f5d63df0a43c25c Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 7 May 2023 11:22:20 +0800 Subject: [PATCH] save project --- func.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/func.py b/func.py index 8397fdf..c06403a 100644 --- a/func.py +++ b/func.py @@ -1,18 +1,24 @@ def new_input(): total = [] while True: - money= input('请输入(q退出):') + unit = input('请输入(q退出):') if unit== 'q': break else: try: - money = int(unit) + unit = int(unit) except: print("请重新输入一个数字") else: total.append(money) finally - input(====) + input("=====================") return total -result = new_input -print(total) \ No newline at end of file +def sum(money) + count = 0 + for i in money + count = count + i + return count +prics = new_input() +pay = sum(price) +print("您一共消费了"+str(pay)+"元!扫码还是现金呢?") \ No newline at end of file -- libgit2 0.25.0