字符串内单词 倒叙

# 实现b的倒叙
c=b[::-1]
print(c)
# 使用join函数连接
d=" ".join(c)
print("倒叙后显示",d)

# 方法2 使用for循环

a="today is best"
b=a.split()
print(b)

# 倒叙排序
c=b[::-1]
print(c)

list=""
for x in c:
    list=list+x+" "
print("倒叙后显示",list)

 

posted @ 2018-08-08 17:32  studylady  阅读(124)  评论(0编辑  收藏  举报