Not working


#1



https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/1?curriculum_id=4f89dab3d788890003000096#


it says:
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


I expect:
for it to work through each letter in the string and add it to place [0] in the list.


def reverse(text):
    s = str(text)
    end = []
    for l in s:
        end.append[0]
    return end


#2

append() is a method, it should have parentheses.

if you do this, append will insert zeroes at the end

what you want to do requires insert()


#3

will that put it in key 0?


#4

lists don't have keys, they have indexes and values. Dictionaries have keys

but yes, with insert() you can specify at which index you want to insert a value


#5

cool. thanks.
I have only been at this 2 weeks, so all the terms are a bit fried in my head.... may be why I used append and not insert. it makes sense now.

Thanks again.


#6

def reverse(text):
s = str(text)
end = ""
for l in s:
end = l + end
finish = str(end)
return finish

that is how I solved it. a list didn't work, but I made a string this way.


#7