List comprehension in Python for if, elif, pass?
Use an if at the end of the list comprehension (a filter) in order to completely exclude an item from the list.  For example, if you wanted to do this as a list comprehension:
result = []
for i in range(10):
    if i % 2:
        result.append("two")
    elif i % 3:
        result.append("three")
    else:
        pass  # note that you do not actually need this "else" at all

you could do:
result = ["two" if i % 2 else "three" for i in range(10) if i % 2 or i % 3]


I see syntax for if pass but not finding syntax for if elif pass: List comprehension with else pass
Basically
if condition:
    something
elif condition
    something
else
    pass

