func.py 358 Bytes Edit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 def b(): a=[] while True: c=input("请输入") if c=="q": break else: try: c=int(c) except: print('请输入整数') else: a.append(c) return a def d(e): f=0 for i in e: f=f+i return f