a="qwhbertyuu" #要截取的字符串
tep=["w","r","y"] #指定分隔符
n=len(tep)
list=[]
def func(n,x):
if n >1 or n==1:
n=n-1
re=x.split(tep[2-n])
re3=x.split(tep[2-n])[-1]
if n==0:
list.append(re[0])
list.append(re[-1])
else:
list.append(re[0])
func(n,re3)
else:
pass
func(n,a)
print(list)
网友评论