how to compare 2 list with same value in python code example
Example 1: python same values in two lists
a = {1, 2, 3, 4}
b = {3, 4, 5, 6}
a.intersection(b)
Example 2: compare two list in python
>>> s = ['a','b','c']
>>> f = ['a','b','d','c']
>>> ss= set(s)
>>> fs =set(f)
>>> print ss.intersection(fs)
**set(['a', 'c', 'b'])**
>>> print ss.union(fs)
**set(['a', 'c', 'b', 'd'])**
>>> print ss.union(fs) - ss.intersection(fs)
**set(['d'])**