Reverse


#1

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

Oops, try again. Your code looks a bit off--it threw a "'list' object attribute 'append' is read-only" error. Check the Hint if you need help!

I'm not sure where I'm going wrong with append. Can you help?

backwards = []

def reverse(text):
    str(text)
    x = len(text)-1 3
    while x in range(len(text)-1, 0, -1):
        backwards.append = text[x]
        return backwards
    print backwards

#2

append() is a method, it requires parentheses, between the parentheses supply what you want to append to the list

place backwards = [] inside the function


#3

Thanks. I'll give it a try.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.