python: restarting a loop -


I have:

  for category (2, n): if ( Some): Do Something else: Do something else I = 2 ** Restart the loop  

But this does not seem to work. Is there any way to restart that loop?

Thanks

Would you like to consider using a different type of loop Logic is applicable because it is the most obvious answer.

Maybe one:

  i = 2 while i & lt; N: If anything: something I + = 1 Other: do something else I = 2 # Restart the loop  

Comments