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.
Traceback (most recent call last):
File "python", line 10, in
File "python", line 6, in join_strings
AttributeError: 'str' object has no attribute 'append'
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)