How to run the loop again with range change based on ‘if statement’?


let us say.
a = 1
b = 10
for i in range(a, b):
if i == 5:
a +=1 # and run loop again.
How would I increase a by 1 and run the loop again?
Is there any way?


That sounds like a loop inside a loop (known as nesting). Have you tried that?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.