7/15 - Help. Thanks


#1

Hi, my codes are:

def reverse(text):

listA = []
num = len(text)-1

for n in text:
    listA.append[num]
    num -= 1

print "".join(listA)

When I ran it, it kept on saying: [Oops, try again. Does your reverse function take exactly one argument (a string)? Your code threw a "'builtin_function_or_method' object has no attribute 'getitem'" error. ]
What does the error message mean? What's wrong with my codes? Thank you


#2

Hi,

you have to change listaA.append[num] to listA.append(num).

Hope it helped.