Take two lists, second with same items than first plus some more:
a = [1,2,3]
b = [1,2,3,4,5]
I want to get a third one, containing only the new items (the ones not repeated):
c = [4,5]
The solution I have right now is:
>>> c = []
>>> for i in ab:
... if ab.count(i) == 1:
... c.append(i)
>>> c
[4, 5]
Is there any other way more pythonic than this?
Thanx folks!