basically, this is what I need to do: x=1 y=x while x <= y: if something: x=x+1 y=y+1 continue dosomething x=x+1 therefore, if the if statement is always true, it should never end, but as soon as it's false, dosomething will happen and it will stop. Dan