About Algorithm Performance
Average case time complexity of membership tests in sets are O(1) vs O(n) for lists.
In other words,
- if you want to find if a value exists in a list, each value of a list will be checked, and
- if you want to find a value in a set, a single hashed value will be checked.