I am trying to delete all values that are lower than 120 in res[1] and delete the value of the same index in res[0], for some reason the loop stops ..and doest continue to delete the end of the list.
thanks a lot for your support
here is the code:
def func ():
res=([30.0,40.0,49.0,28.0,30.0,57.0], [0, 30.0,400.0,160.0, 30.0, 30.0])
for i in res[1]:
if i<120:
ind=res[1].index(i)
res[1].remove(i)
del(res[0][ind])
else:
pass
return res
expected result is ([49.0, 28.0], [400.0, 160.0])
but i have this result ([49.0, 28.0, 30.0, 57.0], [400.0, 160.0, 30.0, 30.0])