I got a little question: I got 2 lists with equal lengths.
As you can see below in my code, if appropriate circumstances take place, I delete some of the elements from the list. I have to do my work very carefully so my question is - does the for loop check by every iteration if len(whole_st_gen) is changing ?? Won't it skip some items??
whole_st_gen = []
whole_end_gen = [] // the length of both of them is 38273
if_merge = 0
here_merge = 0
deleting = False
for x in range (0, len(whole_st_gen)):
if_merge = x
if x == len(whole_st_gen)-1:
break
for y in range (x+1, len(whole_st_gen)):
if whole_end_gen[x]>whole_end_gen[y]:
deleting = True
here_merge = y
continue
else:
break
if deleting == True:
deleting = False
del whole_st_gen[x:here_merge]
del whole_end_gen[x:here_merge]
if_merge = 0
here_merge = 0
print len(whole_st_gen) # here's length is 1852, so i think it could work properly, just want to be sure!
sys.exit()