From 994c481782d7f4ce290974b9af2b554ee623b5a6 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 25 Sep 2022 16:57:44 +0800 Subject: [PATCH] auto save --- func.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 func.py diff --git a/func.py b/func.py new file mode 100644 index 0000000..089e95b --- /dev/null +++ b/func.py @@ -0,0 +1,19 @@ +def fun(): + total = [] + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + total.append(unit) + print(total) +try: + unit=int(input("请输入:")) +except: + print('要输入整数哦~~') +else: + if unit== 'q': + break + else: + total.append(unit) + print(total) -- libgit2 0.25.0