16/18 Using String Lists in Functions


#1

hey i have already figured out what is the right way to write this code:
"result += words[i]" instead of "result.append(words[i])"

but, why can't i write it this way:

n = ["Michael", "Lieberman"]

Add your function here

def join_strings(words):
result = ""
for i in range(len(words)):
result.append(words[i])
return result

print join_strings(n)


#2

.append() is a method that belongs to lists. You can't use it on strings.


#3

understood! thankyou