I need to be able to find differences in list that may have identical values to one another besides two added elements
example
a = ['cool task', 'b', 'another task', 'j', 'better task', 'y']
b = ['cool task', 'b', 'a task', 'j', 'another task', 'j', 'better task', 'y']
How my problem is, both 'a task'
and 'another task'
both are followed by a 'j'
[x for x in b if x not in a]
['a task']
Because both a
and b
contain 'j'
, it is removed from the list.
How would I make so that I end up with
['a task', 'j']