From 7af47e9261b6725718713442951a747ac57d9e3c Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 30 May 2021 10:39:15 +0800 Subject: [PATCH] save project --- 1.py | 6 ++++++ __pycache__/func.cpython-37.pyc | Bin 0 -> 594 bytes func.py | 27 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 1.py create mode 100644 __pycache__/func.cpython-37.pyc create mode 100644 func.py diff --git a/1.py b/1.py new file mode 100644 index 0000000..1997e20 --- /dev/null +++ b/1.py @@ -0,0 +1,6 @@ +import func + +data=func.kk() + +score=sum(data) +print(score) \ No newline at end of file diff --git a/__pycache__/func.cpython-37.pyc b/__pycache__/func.cpython-37.pyc new file mode 100644 index 0000000..32376cb Binary files /dev/null and b/__pycache__/func.cpython-37.pyc differ diff --git a/func.py b/func.py new file mode 100644 index 0000000..24f09f5 --- /dev/null +++ b/func.py @@ -0,0 +1,27 @@ +def kk(): + total = [] + while True: + unit= input("请输入:q退 懂") + if unit== 'q': + break + else: + try: + unit=int(unit) + except: + print("输入整数") + else: + total.append(unit) + finally: + print('-'*30) + return total + + +def sum(money): + count=0 + for i in money: + count=count+i + return count + +# abc=kk() +# pay=sum(abc) +# print('给钱'+str(pay)) -- libgit2 0.25.0