strange result when finding the index of a boolean list
John Palmieri suggest to use v.startswith('$a_') in answer to my former question How to construct a condition on the family name of a variable without notice to its index
.
Here is a little program
RR=['$x_{0}$',
'$x_{1}$',
'$x_{2}$',
'$a_{3}$',
'$\\varepsilon_{4}$',
'$a_{5}$',
'$\\varepsilon_{6}$']
OB=[v.startswith('$a_') for v in RR]
SS=[OB.index(v) for v in OB if v==True]
SS
which give the answer [3,3]
when in my eyes the answer should be [3,5]
. I know this is the standard process to gives the first occurence of the string. But why there is not a defined function which gives all the indexes ?