From 3f9e7995e65e0082ac0635116d3884ec7c99dea4 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Wed, 6 Oct 2021 18:08:19 +0800 Subject: [PATCH] save project --- func.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 func.py diff --git a/func.py b/func.py new file mode 100644 index 0000000..4f26b86 --- /dev/null +++ b/func.py @@ -0,0 +1,23 @@ +def new_input(): + total = [] + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + try: + unit=int(unit) + except: + print("请输入数字") + else: + total.append(unit) + #print(total) + return total +def count(money): + sum=0 + for i in money: + sum=sum+i + return sum +aaa=new_input() +asa=count(aaa) +print(asa) \ No newline at end of file -- libgit2 0.25.0