answered 5 years ago
Use sets, not lists:
sage: set([1, 2, 3, 4]) {1, 2, 3, 4} sage: set([2, 3, 4, 1]) {1, 2, 3, 4} sage: set([1, 2, 3, 4]) == set([2, 3, 4, 1]) True