func.py 355 Bytes Edit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 def new_input: total = [] while True: try: unit=int(input("请输入:")) except: if unit== 'q': break else: total.append(unit) print(total) return total import turtle def sum(money): count=0 for i in money: count+=i return count total sum(total)