Using strings in lists in functions


#1



https://www.codecademy.com/en/courses/python-beginner-nzzVa/3/5?curriculum_id=4f89dab3d788890003000096#


Oops, try again. join_strings(['x', 'y', 'z', 'a']) returned 'x' instead of 'xyza'
Console output:
Michael
None


Hi everyone, I have read all the topics I could find on this lesson, and I really can't see what I'm doing wrong. I have even seen solutions that - to my eye - are identical to what I've written here. So any help would be appreciated greatly!


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

print join_strings(n)


#2

a function ends the moment a return keyword is reached

if a return keyword is reached in a loop, the loop will break


#3

One small indent - thank you!


#4