面试题编程题06-python 输入一个字符串,反转输出

1 s=input('Please input the string:')
2 temp=list(s)
3 temp.reverse()
4 #列表转换为字符串
5 print(''.join(temp))

 

posted @ 2019-05-24 11:48  飞虎就是我  阅读(1960)  评论(0)    收藏  举报