谁能告诉我反转字符串怎么做啊?在线求解

编写一个函数,其作用是将输入的字符串反转过来。输入字符串以字符数组 s 的形式给出。
不允许使用字符串切片和python内建函数reversed( )。

【示例 1】
输入:s = "hello"
输出:"olleh"

【示例 2】
输入:s = "Apple"
输出:"elppA"

a = input('请输入:')
for i in range(len(a)):
    print(a[len(a)-i-1],end='')

循环吧

循环从后面向前面遍历