func.py
434 Bytes
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit = int(unit)
except:
print("XXXXXXXXX数字")
else:
total.append(unit)
print("_"*30)
jkjk=new_input()
def t(jkjk):
colo=0
for i in jkjk:
colo=colo+i
return colo
t(colo[])