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