LISTS AND FUNCTIONS-Using strings in lists in functions-16/18(AttributeError)


#1


Having problems with appending contents of list into an empty string.
Help is appreciated, thanks :slight_smile:








#2

here you have used result=result.append(w)
which is wrong as its a string you should have written result=result+w


#3

The expected code is
n = [“Michael”, “Lieberman”]

Add your function here

def join_strings(words):
result=""
for x in words:
result=result+x
return result

print join_strings(n)


#4

Thanks it worked :smiley:


#5

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