func.py 423 Bytes Edit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 def ss2s(): total = [] while True: unit= input("请输入:") if unit== 'q': break else: try: mone=int(money) except: print('重新输入一个数字') else: total.append(money) finally: print('-'*30) total.append(unit) return total a=ss2s() print(a)