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


#1


https://www.codecademy.com/en/courses/python-beginner-nzzVa/3/5?curriculum_id=4f89dab3d788890003000096

Oops, try again. Your code looks a bit off. Check the console window for errors!
Traceback (most recent call last):
File "python", line 8, in
File "python", line 6, in join_strings
AttributeError: 'str' object has no attribute 'append'

can you check my code?


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

print join_strings(n)


#2

.append() is a function that works for lists, but not strings. When we are working with strings and want to accomplish something similar to .append() we use +=, this is basically the string equivilant to .append().


#3

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