I have a for loop that iterates through a range, but I would like it to skip a number of iterations based on a condition. This is the code:
for i in range(1,100):
if some_condition:
i += some_number
What I am trying to accomplish: So let's say i=5 the some_condition is triggered and some_number=2, this would set i= 7, and then the next i that we iterate to will be 8, so we never iterate through 6 and 7. How can I do this?
whileloop instead.i = 1 while i < 100: ... i += 1then you can adjust the value ofiinside the loop