Most Efficient Way to Find Whether a Large List Contains a Specific String (Python)

The python Set is what you should try.

A set object is an unordered collection of distinct hashable objects. Common uses include membership testing, removing duplicates from a sequence, and computing mathematical operations such as intersection, union, difference, and symmetric difference.

Leave a Comment