a='a1b14c65dd13ff098aa76bb24aa65bb6' #1提取字符串如['a','b','c'...] #2提取数字如['1','14','65',...] #3提取字符串加数字,并排序['a1', 'b14', 'c65', 'aa76', 'aa65', 'bb24', 'bb6', 'dd13', 'ff098']
listd1=[]
slistd=[]
alist=list(a)
global shu
global aa
shu=''
aa=''
d=0
e=0
for i in alist:
if i in ['0','1','2','3','4','5','6','7','8','9']:
shu+=i
d+=1
if e>0:
slistd.append(aa)
aa=''
e=0
else:
aa+=i
e+=1
if d>0:
listd1.append(shu)
shu=''
d=0
slistd.append(aa)
listd1.append(shu)
print(listd1)
print(slistd)
aalist=[]
e=0
d=0
aa=''
for i in alist:
if i in ['0','1','2','3','4','5','6','7','8','9']:
aa+=i
d+=1
else:
if d>0 and e>0:
aalist.append(aa)
aa=''
d=0
e=0
aa += i
e += 1
aalist.append(aa)
print(aalist)
ff=sorted(aalist,key=lambda x:str(x[1]))
print(ff)