1 def output(s,l): 2 if l==0: 3 return 4 print(s[l-1]) 5 output(s,l-1) 6 s = input('Input a string:') 7 l = len(s) 8 output(s,l)
1 Input a string:abcdef 2 f 3 e 4 d 5 c 6 b 7 a