Python wrong four times username and password you need to enter a verification code

Time = 0 
login_success = False 
USER_NAME = "alex" 
PWD = "alex123" 
CHECK_CODE = "123" 

the while Time <4: 
    user_name = the INPUT ( "Please enter your user name:") 
    pwd = the INPUT ( "Please enter your password : ") 

    IF user_name == USER_NAME: 
        IF pwd == PWD: 
            Print (" Congratulations on your successful login ") 
            login_success = True 
            BREAK 
        the else: 
            Print ( 'your user name or password is incorrect, please re-enter') 
            Time = Time + 1 
    the else: 
        Print ( "your user name or password is incorrect, please re-enter") 
        Time = Time + 1 
IF not login_success: 
    the while True:  
        check_code the iNPUT = ( 'please enter verification code: ')
        user_name = the iNPUT ( "Please enter your user name: ") 
        pwd = the INPUT (" Please enter your password: ")
        check_code == CHECK_CODE IF: 
            IF user_name == USER_NAME: 
                IF pwd == PWD: 
                    Print ( "Congratulations on your successful login") 
                    BREAK 
                the else: 
                    Print ( "your user name or password is incorrect, please re-enter") 
            the else: 
                Print ( "your user name or password is incorrect, please re-enter") 
        the else: 
            Print ( "code error, re-enter.")

  

Guess you like

Origin www.cnblogs.com/liuxianhui/p/11468432.html