Why do x[False] and x[True] for Python lists work? [duplicate]
This question already has answers here: Python bool and int comparison and indexing on list with boolean values (4 answers) Closed 5 years ago. If I have x as the list of items, why does x[True] or x[False] modify the first or second elements of the list? Please see code sample below: x = [1, […]