Source Code:
(back to article)
list1 = [1, 2, 3, 4, 5] list2 = [3, 4, 5, 6, 7] # Find the difference between the two lists diff = list(set(list1) - set(list2)) print(diff) # Output: [1, 2]
Result:
Report an issue