intersect in python list

Solutions on MaxInterview for intersect in python list by the best coders in the world

showing results for - "intersect in python list"
Louis
30 May 2017
1>>> a = [1,2,3,4,5]
2>>> b = [1,3,5,6]
3>>> list(set(a) & set(b))
4[1, 3, 5]
5