O'Reilly logo
  • Sri Harsha V thinks this is interesting:

Why sets?


Cover of Learning Python, 5th Edition


Sets can be used to:-
1. Filter duplicates out.
2. Isolate differences in lists, strings and other iterable objects.
3. Perform order-neutral equality tests.
4. Keep track of visited nodes while traversing graph or other cyclic structures.