<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
exercise 16 in using strings in lists in functions ***
NOTE I recently found an identical topic. I’ve tried to delete this post but cannot find how to do so.
<In what way does your code behave incorrectly? Include ALL error messages.>
Traceback (most recent call last):
File “python”, line 10, in
File “python”, line 6, in join_strings
AttributeError: ‘str’ object has no attribute ‘append’
<What do you expect to happen instead?>
I would have expected the function to return result as “MichaelLieberman”. The error message makes me think you can’t use append to concatenate strings, but what do I know.
When I try changing the result to a list ie. result=[""] the append function works, but obviously that’s not what the console wants to see
n = [“Michael”, “Lieberman”]
def join_strings(words):
result=""
for word in words:
result.append(word)
return result
print join_strings(n)
<do not remove the three backticks above>