您没有指定订单是否重要。如果没有,则可以在> = Python 2.7中执行此操作:
l1 = ['a', 'b', 'c', 'b', 'c']l2 = ['a', 'b', 'c', 'b']from collections import Counterc1 = Counter(l1)c2 = Counter(l2)diff = c1-c2print list(diff.elements())

您没有指定订单是否重要。如果没有,则可以在> = Python 2.7中执行此操作:
l1 = ['a', 'b', 'c', 'b', 'c']l2 = ['a', 'b', 'c', 'b']from collections import Counterc1 = Counter(l1)c2 = Counter(l2)diff = c1-c2print list(diff.elements())