index=first+new_l.index(2)
print 'find the index of 2:',index
first=index+1
song@ubuntu:~$ python...l.index(2)
first=False
else:
pos=l.index(2,pos+1)
print pos
song@ubuntu:~$ python...2,2,3,4,5,1,2,3,1,2,3,4,5]
for i in range(len(l)):
if l[i]==2:
print i
song@ubuntu:~$ python...=0:
pos=l.index(2)
else:
pos=l.index(2,pos+1)
print pos
song@ubuntu:~$ python...2,2,3,4,5,1,2,3,1,2,3,4,5]
pos=-1
for i in range(l.count(2)):
pos=l.index(2,pos+1)
print pos
song@ubuntu:~$ python