From 26b1b1736da307e61b5b07f2e4811f8deb2ce414 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 24 Mar 2024 18:02:48 +0800 Subject: [PATCH] auto save --- func.py | 24 ++++++++++++++++++++++++ swim.py/func.py | 24 ++++++++++++++++++++++++ swim.py/swim.py | 3 +++ 3 files changed, 51 insertions(+) create mode 100644 func.py create mode 100644 swim.py/func.py create mode 100644 swim.py/swim.py diff --git a/func.py b/func.py new file mode 100644 index 0000000..ebeac36 --- /dev/null +++ b/func.py @@ -0,0 +1,24 @@ +def aq(): + total = [] + + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + try: + unit=int(unit) + except: + print("重输") + else: + total.append(unit) + finally: + print("-"*30) + return total +def a(money): + count=0 + for i in money: + count++ + return count +result=a(aq) +print("你花了"+str(result)+"元,微信,花呗,支付宝") \ No newline at end of file diff --git a/swim.py/func.py b/swim.py/func.py new file mode 100644 index 0000000..ef12f4c --- /dev/null +++ b/swim.py/func.py @@ -0,0 +1,24 @@ +def aq(): + total = [] + + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + try: + unit=int(unit) + except: + print("重输") + else: + total.append(unit) + finally: + print("-"*30) + return total +def a(money): + count=0 + for i in money: + count++ + return count +result=a(aq) +print("你花了"+str(result)+"元,微信,花呗,支付宝") \ No newline at end of file diff --git a/swim.py/swim.py b/swim.py/swim.py new file mode 100644 index 0000000..78beda3 --- /dev/null +++ b/swim.py/swim.py @@ -0,0 +1,3 @@ +import func +z=func.aq() +x=func.a(z) \ No newline at end of file -- libgit2 0.25.0