Result = result + words[i] V.S. result = words[i] + result


#1


Using strings in lists in functions

Oops, try again. join_strings(['x', 'y', 'z', 'a']) returned 'azyx' instead of 'xyza'

Could someone tell me what is difference between each other. Because I think they are the same..


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

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


#2

The first add string(word[i]) to result (the end of result) ,
unlike the second who add result to the end of string


#3

Ah, I get it. Thanks:D