Python if usage

#if -else
 IF  . 1 == . 1 : 
    Print ( " . 1 =. 1 " )
 the else : 
    Print ( " . 1 not equal. 1 " )
 #if -elif the else-
 IF  . 1 == 2 : 
    Print ( " . 1 = 2 " ) 
# pase be allowed to do nothing and no error will 
elif 2 == 3 : 
    pase 
elif 1 == 1 : 
    Print ( " 1 = 1 " ) 
# only executed once interrupted will not perform a second 
elif2 == 2 : 
    Print ( " 2 = 2 " ) 

the else : 
    Print ( " . 1 is not equal to 2 " )

 

Guess you like

Origin www.cnblogs.com/wanglilu/p/11572433.html