Post

@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

@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 5 will be the answer because the loop will run only 2 times first time after entering in the loop the value will become 3 then again you will come inside the loop then value becomes 5 the your if condition will becomes true and break will make you out of loop then the value =5.
English




















