python conditions (Triad) operator

Conditional operator   is three yuan operator

Syntax: Statement 1  IF    conditional expression  else   statement 2

Execution flow:
   conditional operator, when executed, will first conditional expressions are evaluated determination
          If the determination result is True, the statement 1 is executed, and returns the execution result
          if the determination result is False, the statement 2 is executed, and returns the execution result

 

Guess you like

Origin www.cnblogs.com/FlyingLiao/p/11111871.html