list_one = [1,3,5,6,7] list_two = [1,2,3,4,5,6,7,8,9,10] difference = set(list_two).symmetric_difference(list_one) print(list(difference))
Output:[2, 4, 8, 9, 10]
comparing 2 lists
|
|
Messages In This Thread |
comparing 2 lists - by rwahdan - Jul-18-2021, 05:37 PM
RE: comparing 2 lists - by Yoriz - Jul-18-2021, 06:24 PM
RE: comparing 2 lists - by DeaD_EyE - Jul-18-2021, 06:30 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Split dict of lists into smaller dicts of lists. | pcs3rd | 3 | 2,524 |
Sep-19-2020, 09:12 AM Last Post: ibreeden |
|
Comparing items from 2 lists of dictionaries | illwill | 7 | 2,921 |
Sep-14-2020, 10:46 PM Last Post: bowlofred |
|
sort lists of lists with multiple criteria: similar values need to be treated equal | stillsen | 2 | 3,413 |
Mar-20-2019, 08:01 PM Last Post: stillsen |
|
Comparing values in separate lists | KaleBosRatjes | 3 | 3,137 |
May-02-2018, 04:38 PM Last Post: KaleBosRatjes |