1list=[200500,999508,10003,204090,9876987]
2index_list=[]
3for i in list:
4 n=0
5 i=str(i)
6
7 for j in range(len(i)-3):
8 if i[j]==str(0):
9 if i[j]==i[j+1]==i[j+2]==i[j+3]:
10 n+=4
11 elif i[j]==i[j+1]==i[j+2]:
12 n+=3
13 elif i[j]==i[j+1]:
14 n+=2
15 index_list.append(n)
16