>>> a = [1,1,1,2,3,4,4] >>> b = [1,1,2,3,3,3,4] [1,1,2,3,4] Please note this is not the same question as this: Python intersection of two lists keeping duplicates Because even though there are three 1s in list a, there are only two in list b so the result should only have two. Continue reading...