I would like to return values from both lists that not in the other one:
bar = [ 1,2,3,4,5 ] foo = [ 1,2,3,6 ] returnNotMatches( a,b )
would r
This should do
def returnNotMatches(a, b): a = set(a) b = set(b) return [list(b - a), list(a - b)]
And if you don't care that the result should be a list you could just skip the final casting.