This can be a reason of skipping the element :-
In python everthing is a object and every variable refernce some object
so now,
let say we have a list L
if we remove the list in which we are traversing so because of the referancing we unkowingly vhange the size of the list so it feels like we skip the element but internally it happens becasuse we changed the no of element in the list which cause the skipping
Ex-
L=[1,2,2,3,4]
we are traversing on the list and let say we want to remove the element 2
index = 0
it compares the list L[0] = 1
nothing happens
list is L=[1,2,2,3,4] [becsue we have the referance of the list]
goes to next index
index = 1
it compares list L[1] = 2
removes the element
now the list is L=[1,2,3,4]
goes to next index
index = 2
L=[1,2,3,4]
in this list L[2] = 3
goes to next index
index = 3
L=[1,2,3,4]
index 3 L[3] = 4
nothing happens
goes to next index
condition false "terminate the loop"
Correct me if i am wrong in here
thank you 😄