From a6c848adf46bda1bf651a84393e6b739e4a7aa46 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 18 Mar 2023 15:36:43 +0800 Subject: [PATCH] save project --- 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..7125fd2 --- /dev/null +++ b/func.py @@ -0,0 +1,19 @@ +def new_input(): + 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 + +o=new_input() +print(o) \ No newline at end of file -- libgit2 0.25.0