From 24ca37673858642820e88563d3300afafc2d14eb Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 17 Jul 2022 09:51:06 +0800 Subject: [PATCH] save project --- 1.py | 4 ++++ __pycache__/func.cpython-37.pyc | Bin 0 -> 501 bytes func.py | 21 +++++++++++++++++++++ 3 files changed, 25 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..e31685c --- /dev/null +++ b/1.py @@ -0,0 +1,4 @@ +import func +t=func.new_input() +h=func.a(t) +print("这位选手的总分数是",h) \ 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..0203d7c 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..a90c448 --- /dev/null +++ b/func.py @@ -0,0 +1,21 @@ +def new_input(): + total = [] + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + try: + total.append(int(unit)) + except: + total.append(unit) + return total +def a(money): + b=0 + for i in money: + b+=i + return(b) +#c=new_input() +#d=a(c) +#print(d) + -- libgit2 0.25.0