Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

merge two lists python remove duplicates

first_list = [1, 2, 2, 5]
second_list = [2, 5, 7, 9]

resultList= list(set(first_list) | set(second_list))

print(resultList)
# Results in : resultList = [1,2,5,7,9]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #merge #lists #python #remove #duplicates
ADD COMMENT
Topic
Name
8+3 =