In a typical C-like language a for loop gives you more control over iteration. I'm wondering how to do the equivilent
for(int i = 0; i < A.length; i++) {
do_things(A[i]);
if (is_true(i)) {
i--;
}
}
in Python?
In other languages I opt to use their container based for loop constructs, but they typically have vanilla for loops that I can use for situations like this. How do I get more "control" when iterating in Python?
I imagine the answer to this is very basic, but the search terms are muddied with other questions.
breakstatement, which exists in Python.continueinstead then. Decrementingiis the wrong action.