From 31c54986c6635bb83ae40f11257d5000902433b4 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Fri, 3 Dec 2021 20:21:21 +0800 Subject: [PATCH] save project --- func.py | 26 ++++++++++++++++++++++++++ use.py | 0 2 files changed, 26 insertions(+) create mode 100644 func.py create mode 100644 use.py diff --git a/func.py b/func.py new file mode 100644 index 0000000..be2e7ea --- /dev/null +++ b/func.py @@ -0,0 +1,26 @@ +def new_input(): + total = [] + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + try: + unit = int(unit) + except: + print("请输字") + else: + total.append(unit) + finally: + print("====================") + 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) + "") diff --git a/use.py b/use.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/use.py -- libgit2 0.25.0