How can i use (x.append()) in this code?


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

Replace this line with your code. 

n = ["Michael", "Lieberman"]
def join_strings(words):
    result = ""
    for i in range(len(words)) :
    return result# Add your function here
print join_strings(n)


If x is a string then you can't, strings don't have such a method, just like the error message says. Strings can't be changed, you can only make new ones.


thank you man :grinning:


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