From f9457758d3406c87466f82152abefdf3a078271b Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 9 Jan 2022 17:24:47 +0800 Subject: [PATCH] save project --- __pycache__/func.cpython-37.pyc | Bin 0 -> 538 bytes func.py | 21 +++++++++++++++++++++ sb.py | 3 +++ 3 files changed, 24 insertions(+) create mode 100644 __pycache__/func.cpython-37.pyc create mode 100644 func.py create mode 100644 sb.py diff --git a/__pycache__/func.cpython-37.pyc b/__pycache__/func.cpython-37.pyc new file mode 100644 index 0000000..35ff672 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..2a2bf2c --- /dev/null +++ b/func.py @@ -0,0 +1,21 @@ +def new_input(): + total = [] + while True: + unit=input("请输入:") + if unit== 'q': + break + try: + unit= int(unit) + except: + print("输整数") + else: + total.append(unit) + return total +def sum(money): + a=0 + for i in (money): + a=a+i + return a +list=new_input() +#print(sum(list),"元") +#print(list) \ No newline at end of file diff --git a/sb.py b/sb.py new file mode 100644 index 0000000..5adc3fd --- /dev/null +++ b/sb.py @@ -0,0 +1,3 @@ +import func +list=func.new_input() +total=func.sun() \ No newline at end of file -- libgit2 0.25.0