What am I doing wrong?


#1



console says

Traceback (most recent call last):
File "python", line 9, in
File "python", line 6, in join_strings
AttributeError: 'str' object has no attribute 'append'

little box at the bottom says

Oops, try again. Your code looks a bit off. Check the console window for errors!


n = ["Michael", "Lieberman"]
# Add your function here
def join_strings(words):
    result = ""
    for item in words:
        result.append(item)
    return result

print join_strings(n)


#2

.append() is a method of the List class. Try using concatenation:

x = x + s

#3

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