I'm having trouble with the "Reverse" exercise. I have successfully created a list with all of the letters in reverse order, but I'm having trouble getting that list back into a string variable. Here is my code:
def reverse(text): text = list(text) txet =  i = int(len(text)) - 1 while i > -1: txet.append(text[i]) i = i - 1 txet = str(txet) return ''.join(txet) print reverse('Python!')
I'm getting back 'Python!' as a list containing ['!', 'n', 'o', 'h', 't', 'y', 'P'], which is pretty cool. But "return ''.join(txet)" is not giving me back the list joined as a string like I am expecting. Does anyone have any suggestions?
I have also tried storing the result of ''.join(txet) in a new variable and printing that, but that is producing the same result. I have tried the same process in the Python 3.5 shell and it seems to work there:
a = ['a', 'b', 'c']
But pasting my code into IDLE and running it (after updating for syntax changes for Python 3.5) produces the same result I'm getting here in the Codecademy interpreter.