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)