If you want a clean code.
list1 = [1, 2, 3] list2 = [2, 3, 4] list3 = [4, 5] merged = list(set(list1 + list2 + list3)) print(merged) // Result -> [1, 2, 3, 4, 5]