Using strings in lists in functions 16/18


Using strings in lists in functions 16/18

Please could someone explain why this woulldn’t work? I dont understand why I cant use append.


Replace this line with your code.
def join_strings(words):
result = ""
for i in range(len(words)):
return result


The append() method appends a passed object into a list. So as you can see, append() only works with lists. result isn’t a list, so why append() to it?

Hint: Did you see that they didn’t highlight append in the instructions? That means they don’t want you to use that method.


ah okay I understand now. thanks so much :slight_smile:


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