from collections import Counter lista_0 = ['a', 'd', 'c', 'c', 'a', 'b'] lista_1 = ['a', 'b', 'c', 'd', 'a', 'b'] print(Counter(lista_0) == Counter(lista_1))