Place an if clause after the for clause to skip values. Filtering keeps duplicate values unless you explicitly remove them.
A form keeps the nonblank tags in the order they were entered.
entries = ["west", "", "west", "east"]
tags = [entry for entry in entries if entry]
print(tags) # ['west', 'west', 'east']The if clause decides whether an item is included. Returning the item itself keeps its original value and allows repeats.
Return only scores greater than or equal to minimum in their original order. Include duplicates.
passing_scores([8, 3, 7, 8], 7) # [8, 7, 8]