7. reverse


I do not understand how I am meant to write the code so that any text is reversed. Can anybody help me as I do not remember ever having to reverse text.


well , could you show me what was your first code i mean what did you try to do ? :confused:


For me, the key was using lists. I went over the list section again and it really helped.


I've just got the function sorted.
My code is just this:
def reverse(text):
letters = []
for reverse in letters:

Please help me.


I added an empty list, but I don't know what to add next.


Like this:
def reverse(text):
for i in range(len(text)-1,-1,-1):
return text_r
print reverse("Python!")


I've got it sorted now, thank you. This was a great help.


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