str1='i like yuo ,but just i like yuo.'
list_number = str1.split(' ',10)
list_number.reverse()
list1=[]
for i in list_number:
x1=re.match('(\w+)(\W)',i)
x2=re.match('\w+',i)
x3=re.match('(\W)(\w+)',i)
if x1:
x=x1.group(1)
y=x1.group(2)
list1.append(y)
list1.append(x)
elif x2:
z=x2.group()
list1.append(z)
elif x3:
list1.append(x3.group(2))
list1.append(x3.group(1))
a=''
for j in list1:
a=a+j+' '
print(a)
对一句英语话的倒序排列英语单词不变
最新推荐文章于 2024-07-19 16:36:18 发布