From d41fa03e9949e0451ca881f08735bbf5a86a715e Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 10 Jul 2022 11:49:20 +0800 Subject: [PATCH] save project --- 1.py | 24 ++++++++++++++++++++++++ 2.py | 4 ++++ __pycache__/func.cpython-37.pyc | Bin 0 -> 596 bytes func.py | 24 ++++++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 1.py create mode 100644 2.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..24f105c --- /dev/null +++ b/1.py @@ -0,0 +1,24 @@ +def new_input(): + total=[] + while True: + unit=input("shur") + if unit=="q": + break + else: + try: + unit=int(unit) + except: + print("shuzhengshu") + else: + total.append(unit) + finally: + print("====") + return total +def sum(money): + count=0 + for i in money: + count=count+i + return count +price=new_input() +pay=sum(price) +print(str(pay)+"yuan") \ No newline at end of file diff --git a/2.py b/2.py new file mode 100644 index 0000000..74d42f3 --- /dev/null +++ b/2.py @@ -0,0 +1,4 @@ +import func +data=func.new_input() +scroe=func.sum(data) +print(scroe) diff --git a/__pycache__/func.cpython-37.pyc b/__pycache__/func.cpython-37.pyc new file mode 100644 index 0000000..6b54abe 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..db1a53e --- /dev/null +++ b/func.py @@ -0,0 +1,24 @@ +def new_input(): + total=[] + while True: + unit=input("shur") + if unit=="q": + break + else: + try: + unit=int(unit) + except: + print("shuzhengshu") + else: + total.append(unit) + finally: + print("====") + return total +def sum(money): + count=0 + for i in money: + count=count+i + return count +price=new_input() +pay=sum(price) +print(str(pay)) \ No newline at end of file -- libgit2 0.25.0