python实现翻转字符串 1从右向左截取2.reversed()3.reduce + lambda反转法 1从右向左截取 代码如下(示例): str = "adsfshw" print(str[::-1]) 代码结果如下: 2.reversed() 代码如下(示例): str = "adsfshw" print(''.join(reversed(str))) 代码结果如下: 3.reduce + lambda反转法 from functools import reduce str = "adsfshw" print(reduce(lambda x , y : y + x,str)) 代码结果如下: