I have a piece of my code where I\'m supposed to create a switchboard. I want to return a list of all the switches that are on. Here \"on\" will equal True and
True
If you have numpy available:
>>> import numpy as np >>> states = [False, False, False, False, True, True, False, True, False, False, False, False, False, False, False, False] >>> np.where(states)[0] array([4, 5, 7])