I am new in Python and I got confused about the way that \"break\" works in a for loop. There is an example in Python documentation(break and continue Statements) which calc
Sure - Simply put out-denting the "Break" means it's no longer subject to the "if" that precedes it.
The code reads the if statement, acts on it, and then regardless of whether that if statement is true or false, it executes the "break" and drops out of the for loop.
In the first example the code only drops out of the 'for' loop if the n%x==0 statement is true.