sh_07_ train station security

 

sh_07_ train station security

# Define a Boolean variable indicating whether or not the ticket has_ticket 
has_ticket = True 

# define an integer variable knife_length represented knife length, unit: cm 
knife_length 10 = # first checks tickets, if any, was allowed security IF has_ticket:
     Print ( " ticket check, ready to start screening " ) # when security is required to check the length of the knife, to determine whether more than 20 centimeters IF knife_length> 20 : # If more than 20 cm, length of blade tips are not allowed on the train Print ( " you carry knife too long, there is% d cm long! " % knife_length)
         Print ( " not allowed on the bus " ) # if no more than 20 cm, by security else




    
    

        
        

    
    :
         Print ( " security has passed, I wish you a pleasant journey! " ) 

# If there are no tickets, the door does not allow 
the else :
     Print ( " Brother, please buy a ticket " )

 

Guess you like

Origin www.cnblogs.com/shaohan/p/11468253.html