For example, in C++ I could do the following :-
for (i = 0; i < n; i++){
if(...){ //some condition
i = 0;
}
}
This will effectively reset the loop, i.e. start the loop over without introducing a second loop
For Python -
for x in a: # 'a' is a list
if someCondition == True:
# do something
Basically during the course of the loop the length of 'a' might change. So every time the length of 'a' changes, I want to start the loop over. How do I go about doing this?
whileloop, or recursion.