Python Control flow with line divisions -


this question has answer here:

currently maintaining large application in python , came across this:

if \     , b or c:     d elif \     , c:     d else:     e 

where a, b, c boolean expressions, , d , e statements executed. d same statement in each clause, if , elif conditions cause same sequences executed (if understanding correct).

but d different each block; how logic evaluated, particularly in if block? like:

if , (b or c) 

which equivalent to

if (a , e) 

for e = b or c; or more like

if (a , b) or c 

which equivalent to

if (e or c) 

for e = a , b ?

my intuition it's former, wanted sure.

breaking line \ code cleanliness, not affect execution or evaluation order. since and has higher precedence or, condition evaluated (a , b) or c.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -