Reverse


#1



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


I keep getting the error message: "Oops, try again. Your code looks a bit off--it threw a "'list' object has no attribute 'join'" error. Check the Hint if you need help!" I'm not entirely sure as to why i am getting this error...


I have read the other messages about this exercise but i am still confused, any help would be much appreciated.


def reverse(text):
    x=[]
    for char in text:
        x.append(char)
    y=[]
    a=len(x)
    while a>0:
        a=a-1
        y.append(x[a])
        for i in y:
            y.append(i)
            print y.join()


#2

join is a string method that takes a list as the argument.

''.join(y)

The string is the separator for join to use on the list in the new string.


#3

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