反转字符串

#现有字符串a="Im Love python",需要变成b="python love Im"

a="Im Love python"
b=' '.join(reversed(a.split(" "))) #字符串空格分割并反转通过空格连接以前
print(b)
原文地址:https://www.cnblogs.com/xiaokuangnvhai/p/11204170.html