It is definitely not possible to use set operations directly, because the elements in the list are still lists, which are mutable objects, and the objects of set operations must be immutable objects, so if you want to repeat it, the simpler method is The reply above is converted into an immutable object tuple, so that the set can be deduplicated. As follows, it is actually traversal.
You can use the following code to achieve it:
Check results:
It can be like this:
Check results:
It is definitely not possible to use set operations directly, because the elements in the list are still lists, which are mutable objects, and the objects of set operations must be immutable objects, so if you want to repeat it, the simpler method is The reply above is converted into an immutable object tuple, so that the set can be deduplicated. As follows, it is actually traversal.