I can get the first index by doing:
l = [1,2,3,1,1] l.index(1) = 0
How would I get a list of all the indexes?
l.indexes(1) = [0,3,4]
?
>>> l = [1,2,3,1,1] >>> [index for index, value in enumerate(l) if value == 1] [0, 3, 4]