Boolean list Python code example
Example 1: Python Booleans
print(10 > 9)
print(10 == 9)
print(10 < 9)
Example 2: apply boolean to list
>>> from itertools import compress
>>> list_a = [1, 2, 4, 6]
>>> fil = [True, False, True, False]
>>> list(compress(list_a, fil))
[1, 4]