Post

@PythonPr 5 - Because the if statement tests True so the break occurs there.
English

@PythonPr By the way, Python is the very first language where I see while being combined with else.
English

@PythonPr In Python, an else block following a loop executes only if the loop finishes "naturally" meaning it exhausted all items in the sequence or the condition became false.
This is why is not triggering else block, because its triggering the "break", unless you change the x=1 to x=2.
English

















