I have a list of zeroes and one, and I am finding each position where zero occurs. Here is my code.
sample = [1, 0, 1, 0, 1]
ind = []
for i in range(0, 5):
ind.append(sample.index(0))
sample[sample.index(0)] = 1
print(ind)
This code is showing ValeError: 0 is not in the list