16/18 : AttributeError: 'str' object has no attribute 'append'. I have my code below : n = ["Michael", "Lieberman"] def join_strings(words): result = "" for ...
Of course not, because it's a string and you can't append to string. String are immutable. You can concatenate (as in, "there's a new object that consists of these two") strings. But you cannot append (as in, "this specific object now has this at the end") to them.
Solution 3. The python variable should be checked for the list. if the variable is of type list, then call the append method. Otherwise, take the alternative path and ignore the append () attribute. The example below will show how to check the type …
The AttributeError: 'str' object has no attribute 'append' error occurs when the append() attribute is called in the str object instead of the concatenation ...