Analog user login (three opportunities)

= the User ' Shunya dream ' 
password = ' 123456 ' 
COUNT = 3
 the while COUNT> 0:
    A = the INPUT ( ' Please enter your user name: ' )
    b = the INPUT ( ' Please enter your password: ' )
     IF A == the User and b == password:
         Print ( ' Congratulations on your successful login Please wait ...! ' )
         Print ( '' ' % S, welcomes you enter python learning system     
        Your password is% s
        '' ' % (The User, password))                    # placeholder text input replacement 
        BREAK                                      # successful login, the loop exits 
    the else :
        COUNT - = 1                                 # Each time input error, reduce the chance of a 
        IF COUNT <1 :
             Print ( ' Sorry you have no chance to try!. ' )
             BREAK                                  # chance to run out exit loop 
        Print ( ' note: you have ' + str (COUNT) + ' chance to try! ' )      # numeric type conversion

These are today learned in the learning process content

Guess you like

Origin www.cnblogs.com/xuminzgl/p/11869961.html