I have an array of integers:
samples = [123,125,125,120,0,132,133,123,123,...,125,0,133,133,120]
I had seen methods to find an element in the array. But those examples are looking for one element with no duplicate in the array. In my case, I would like to find the index of '0' but in my array, I have two '0's in it.
If I only have one '0' in the array, this method will work:
if sample.count(0)==1:
b = sample.index(0)
and b would contain the position of '0' in the array. If I try it with the array containing two '0's, this wouldn't work any more because of the duplicate. I only want to find the index of the first '0'. How do I solve this?