Reverse


#1

I have written this code to reverse the string and print but I am getting the result incorrect. Can anyone tell me the reason

def reverse(text):
  size = len(text)
  for i in range(size):
    print text[size-1-i]

#2

you need to return the reversed string, currently you only print the reversed string


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.