Combining Lists

I have two lists such that each list contains no repeated elements. However, the lists do share some elements, and I want to combine the lists such that no elements are repeated. For example, if list_1 is \([1,2,4]\) and list_2 is \([1,3,5]\), then the combined list should be \([1,2,4,3,5],\) not \([1,2,4,1,3,5].\)

To accomplish this, what should go in place of "FILL ME IN" in the code below?

1
2
3
4
for element in list_2:
    if "FILL ME IN":
        list_1.append(element)
print list_1
×

Problem Loading...

Note Loading...

Set Loading...