Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

# difference between list 1 and list 2

# difference between list 1 and list 2

list1 = [5,7,9,27,10,30,40,50,75,47,66,89,121,566,100]
list2 = [5,7,9,27,10,30,40,75,66,89,121,566,100] 
list3 = set(list2)
dif = [item for item in list1 if item not in list3]
print(dif)

# [50, 47]
 
PREVIOUS NEXT
Tagged: #difference #list #list
ADD COMMENT
Topic
Name
8+7 =