my code is as below. it throw a error that "String index out of range". I checked and seems it should be ok. Could anyone help to point my mistake? Thank you!
def reverse(text): string = "" for i in range(len(text)): string[i] += text[len(text) - 1 - i] return string