From 9003f387a9b9cc8e3fb3ea797043a8951e24dca8 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 21 Nov 2020 20:16:04 +0800 Subject: [PATCH] auto save --- fg.py | 5 +++++ func.py | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 fg.py create mode 100644 func.py diff --git a/fg.py b/fg.py new file mode 100644 index 0000000..6b3a5e4 --- /dev/null +++ b/fg.py @@ -0,0 +1,5 @@ +try: + age=int(input('你今年几岁了?')) +except: + print('要输入整数啊') +print('程序结束') \ No newline at end of file diff --git a/func.py b/func.py new file mode 100644 index 0000000..9085714 --- /dev/null +++ b/func.py @@ -0,0 +1,17 @@ +def new_input()): + total = [] + while True: + unit= input("请输入:") + if unit== 'q': + break + try: + hss=int(unit) + except: + print('请输入数字') + else: + total.append(unit) + print(total) + return total +new_input() +re=new_input() +print(re) \ No newline at end of file -- libgit2 0.25.0