3 ms·
I think that the subtle difference is that in the second example "print('>= 2')" is always executed whereas in the first example the print statements is execute
by znpy 8y ago
I think that the subtle difference is that in the second example "print('>= 2')" is always executed whereas in the first example the print statements is executed only if no break was executed in the while loop.
Quoting documentation: "A break statement executed in the first suite terminates the loop without executing the else clause’s suite."
- kasbah 8y agoI did say "unless you use a break". I don't think this is very useful.