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

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

 

转载于:https://www.cnblogs.com/feihujiushiwo/p/10917231.html