I am trying to compare two lists ( which contain different sizes of sublists) and finding pair (enclosed in round bracket) that's not present in the other list.
Here is the code:
s1 = [
[('RESOLVED - DUPLICATE', 'VERIFIED')], [('NEW', 'RESOLVED - FIXED'), ('RESOLVED - FIXED', 'VERIFIED')], [('NEW', 'RESOLVED - DUPLICATE'), ('RESOLVED - DUPLICATE', 'VERIFIED')], [('ASSIGNED', 'RESOLVED - FIXED'), ('RESOLVED - FIXED', 'VERIFIED')], [('NEW', 'RESOLVED - WONTFIX'), ('RESOLVED - WONTFIX', 'VERIFIED')], [('NEW', 'RESOLVED - INVALID'), ('RESOLVED - INVALID', 'VERIFIED')]
]
s2 = [
[('RESOLVED - DUPLICATE', 'VERIFIED')], [('NEW', 'RESOLVED - DUPLICATE'), ('RESOLVED - DUPLICATE', 'VERIFIED')], [('NEW', 'ASSIGNED'), ('ASSIGNED', 'RESOLVED - FIXED')], [('ASSIGNED', 'RESOLVED - FIXED'), ('RESOLVED - FIXED', 'VERIFIED')], [('NEW', 'RESOLVED - WONTFIX'), ('RESOLVED - WONTFIX', 'VERIFIED')]
]
a = []
for item in s2:
i = 0
print item
while (i < len(item)):
for item1 in s1:
print item[i]
if item[i] not in s1:
a.append(item[i])
i = i + 1
print a
The above-mentioned code is not giving distinct pair that is present in s2 but not in s1.
Any help would be much appreciated. Thanks!