We have two lists:
a=['1','2','3','4'] b=['2','3','4','5']
How to get a list with elements contained in both lists:
a_and_b=['2','3','4']
and a list with items contained in only one list, but not the other:
only_a=['1'] only_b=['5']
Yes, I can use loops, but this is lame =)
source share