Quantcast
Channel: Active questions tagged set-difference - Stack Overflow
Viewing all articles
Browse latest Browse all 36

Get difference between two lists with Unique Entries

$
0
0

I have two lists in Python:

temp1 = ['One', 'Two', 'Three', 'Four']temp2 = ['One', 'Two']

Assuming the elements in each list are unique, I want to create a third list with items from the first list which are not in the second list:

temp3 = ['Three', 'Four']

Are there any fast ways without cycles and checking?


Viewing all articles
Browse latest Browse all 36

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>