From 1224a72f187834c1059ea16affafc8d22d448e07 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 19 Dec 2021 16:32:45 +0800 Subject: [PATCH] save project --- new.py/__pycache__/func.cpython-37.pyc | Bin 0 -> 601 bytes new.py/func.py | 23 +++++++++++++++++++++++ new.py/new.py | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 new.py/__pycache__/func.cpython-37.pyc create mode 100644 new.py/func.py create mode 100644 new.py/new.py diff --git a/new.py/__pycache__/func.cpython-37.pyc b/new.py/__pycache__/func.cpython-37.pyc new file mode 100644 index 0000000..51b64ba Binary files /dev/null and b/new.py/__pycache__/func.cpython-37.pyc differ diff --git a/new.py/func.py b/new.py/func.py new file mode 100644 index 0000000..4a788ef --- /dev/null +++ b/new.py/func.py @@ -0,0 +1,23 @@ +def sum(money): + c=0 + for i in money: + c=c+i + return c + +def new_input(): + total = [] + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + try: + unit=int(unit) + except: + print("请输入一个数字!!!!") + else: + total.append(unit) + print("_"*30) + return total +#c=sum(new_input()) +#print(c) \ No newline at end of file diff --git a/new.py/new.py b/new.py/new.py new file mode 100644 index 0000000..06004c6 --- /dev/null +++ b/new.py/new.py @@ -0,0 +1,4 @@ +import func +data = func.new_input() +score = func.sum(data) +print("这位SB的总分是:"+str(score)) \ No newline at end of file -- libgit2 0.25.0