fork download
  1. # your code goes here
  2.  
  3.  
  4. def reverse_string(str,a):
  5. # n = len(str)
  6. # i =0
  7. # while(i <=n-1):
  8. # print(str[n-1-i],end = "")
  9. # i = i+1
  10.  
  11. # print()
  12. # for i in range(n):
  13. # print(str[n-1-i], end = "")
  14.  
  15. # print()
  16. if (a<0):
  17. return
  18.  
  19. print(str[a], end = "")
  20. reverse_string(str, a-1)
  21.  
  22.  
  23.  
  24.  
  25. str = input()
  26. n = len(str)
  27. a = n-1
  28.  
  29. reverse_string(str,a)
Success #stdin #stdout 0.03s 9688KB
stdin
Python
stdout
nohtyP