你可以通过一个while循环来实现:
step = 1 i = 1 while i < 100: if ...... : step = 1 #do stuff else: step = 2 #do other stuff i+=step