09 if ... elif..else statement

1, using the format:

  if Condition 1:

    1 thing

  elif Condition 2:

    2 things

  else condition 3:

    3 things

  Description: When the condition 1 is satisfied, 1 point thing, and then the whole end if

     When the condition 1 is not satisfied, it is judged that conditions 2, if the condition 2 is satisfied, the implementation of 2 things, then the end of the whole if

        When the condition 1 is not satisfied, the condition 2 is not satisfied, if the condition 3 is satisfied, the implementation of 3 things, then the end of the whole if

  

 

 2, if an arithmetic operation implemented trinocular

  a if a>b else b

  If a> b condition is satisfied, the operation is the result of three head a, b otherwise

  

 

 

  

    

Guess you like

Origin www.cnblogs.com/shanlu0000/p/12322768.html