s=input("Word: ") r='' for char in reversed(s): r+=char print(r) print ("Reversed word is %s " % (r))
这是我使用的代码,它起作用了谢谢你的回答