func.py 315 Bytes Edit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 def new_imput(): total = [] while True: try: unit=int(input("func:")) except: if unit=='q': break else: print("输入有误") else: total.append(unit) input() return total new_imput()