Set Comprehensions
PY · Tuples & Sets{expression for item in iterable if condition}emails = ["[email protected]", "[email protected]", "[email protected]", "[email protected]"]
unique_lower = {e.lower() for e in emails}
print(unique_lower){'[email protected]', '[email protected]', '[email protected]'}Note Set comprehensions automatically deduplicate results. Useful for extracting unique transformed values from a collection.