a = [1, 2, 3, 1, 2, 3] b = [3, 2, 1, 3, 2, 1]
a & b should be considered equal, because they have exactly the same elements, only in different
Using the unittest module gives you a clean and standard approach.
unittest
import unittest test_object = unittest.TestCase() test_object.assertCountEqual(a, b)