I don't understand the error message, and I don't understand why my code isn't working.
I have included comments in the code to show what i'm expecting it to do
I get the error message:
"Oops, try again. Your code looks a bit off--it threw a "'str' object has no attribute 'insert'" error. Check the Hint if you need help!"
def reverse(text): for char in text: #iterate through each character in text reverse_text = "" start = 0 x = len(text)-1 #starts from the final index of text end = text[x] #takes final character of text variable reverse_text.insert(start, end) #inserts last character of text at begining of reverse_text x -= 1 #moves along the index of text from right to left start += 1 #moves to the next index of reverse_text starting at the left return reverse_text