#选择一串字符串中长度最长的持续数字
def choose(alist):
res=[]
m=1
a=[str(x) for x in range(10)]
n=len(alist)
i=0
while i<n-1:
nextm=1
nextres=[]
if alist[i] in a:
nextres.append(alist[i])
while alist[i+1] in a:
if int(alist[i]) +1 == int(alist[i+1]):
nextm +=1
nextres.append(alist[i+1])
i = i+1
# else:
# break
if nextm >= m:
m= nextm
res = nextres
i += 1
return res
print(choose("123456sjdhgfjs4562sdf"))