Need help for 7/15 Reverse


def reverse(text):
for char in range(len(text) - 1, 0, -1):
print char

Above is my code. I get the error message that it wouldn’t work if there are special characters like ‘!’. Need help!


Eh, you sure special characters had anything to do with it? What makes you say that? Exclamation point isn’t very special. I suspect the problem is that your function is printing the result, meaning that other code can’t obtain the reversed text when they use that function. Can’t for example reverse it twice to obtain the original.


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