Using strings in lists and function


#1



I can't get past this. I've tried almost everything and something is always amiss every single time. Below is the code which I've tried most recently and the following error show up>>>>

File "python", line 10, in <module
File "python", line 6, in join_strings
AttributeError: 'str' object has no attribute 'append'


def join_strings(words):
    result = ""
    for i in range(len(words)):
        words.append(result)
    return result
print joint_strings(n)


#2

append() is a method to append to a list, it can't be used to add to string

How could we add to string?


#3

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