16. Using strings in lists in functions


where do I get it wrong?

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

print join_strings(n)


.append() is a method to append items to a list, .append() can't add to strings.


so if I was asked to add numbers together instead of words, my formula would have worked right?


No, .append() can adds items (strings, booleans, integers) to a list.


Hi! You see, append is like prolong, but has nothing to do with math addition.
It is prolongs the list, but does not perform any operations with its items, rather adds another item to the end of the list or to a certain position.


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