Whats the problem in this code!


n = ["Michael", "Lieberman"]

Add your function here

def join_strings(words):
result == ""
for i in words:
result = result + result.append(i)
return result

print join_strings(n)

it gives the error message:Oops, try again. join_strings(['x', 'y', 'z', 'a']) resulted in an error: local variable 'result' referenced before assignment

thankyou for the help



result == ""

two equal sign means check if equal, why would you do this here?


result = result + result.append(i)

append() a method for appending to lists. use + to concat strings


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