def rv(s):if s =="":return selse:return rv(s[2:])+s[1]
写错了吧,是 return rv(s[1:])+s[0]
这就是个为了递归而递归的典型案例都已经用到切片操作了,直接反向切片不香吗