What is the easiest way to compare the 2 lists/sets and output the differences? Are there any built in functions that will help me compare nested lists/sets?
Inputs:
By using set comprehensions, you can make it a one-liner. If you want:
to get a set of tuples, then:
Differences = {tuple(i) for i in First_list} ^ {tuple(i) for i in Secnd_list}
Or to get a list of tuples, then:
Differences = list({tuple(i) for i in First_list} ^ {tuple(i) for i in Secnd_list})
Or to get a list of lists (if you really want), then:
Differences = [list(j) for j in {tuple(i) for i in First_list} ^ {tuple(i) for i in Secnd_list}]
PS: I read here: https://stackoverflow.com/a/10973817/4900095 that map() function is not a pythonic way to do things.