Something like this
new_list = [expression for member in iterable if conditional]
Dict comprehension:
>>> quote = "life, uh, finds a way"
>>> {char for char in quote if char in "aeiou"}
{'a', 'e', 'u', 'i'}
Something like this
new_list = [expression for member in iterable if conditional]
Dict comprehension:
>>> quote = "life, uh, finds a way"
>>> {char for char in quote if char in "aeiou"}
{'a', 'e', 'u', 'i'}