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
Simply do this:
def which_index(self): return [ i for i in range(len(self.states)) if self.states[i] == True ]