Need help for 7/15 Reverse


#1

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!


#2

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.


#3

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