- 帖子
- 897
- 积分
- 1198
- 技术
- 3
- 捐助
- 0
- 注册时间
- 2018-1-17
|
本帖最后由 netdzb 于 2020-4-29 14:10 编辑
回复 2# Batcher
python版我发了,不过我的方法好像很烦。如果reverseh后join加复原空格,我是能勉强写出来的代码。
我想看一下有无更好的方法。
ubuntu linux python
变成下面的样子
utnubn xunil nohtyp
代码我自己写了一点
s = "abcde"
def str_reverse1(s):
return s[::-1]
if __name__ == '__main__':
rs = str_reverse1(s)
print(rs) |
|