What am I doing wrong?


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:
    return result

print join_strings(n)


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

x = x + s


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