9. User login (unsuccessful attempts to enter the opportunity) and each displays the remaining number of errors when transmission errors

1).

= 3 i 
 username = "yangxiaoer" 
 password = "123456" 
 the while i> = 0: 
     name = the INPUT ( "Please enter your user name:") 
    IF name == username: 
         passwd = the INPUT ( "Please enter your password: ") 
         IF == passwd password: 
             Print (" Please wait a successful login "). 
             Print ( '' ' 
             username:% S 
             password:% S 
             ' ''% (username, password)) 
             BREAK 
         the else: 
             Print (" your Please re-enter the wrong password ") 
             Print ("% s chance you have "% (i-1)) 
             IF i == 0: 
                 Print ( 'your chance has been exhausted, the end of this operation') 
                 BREAK 
      the else: 
         Print ( "! Your user name is incorrect, please re-enter")
         print ( "% s chance you have"% (i-1)) 
     i - = 1

  

2).

 

= username "yangxiaoer" 
password = "123456" 
i = 3 
the while i> 0: 
    zh = the INPUT ( "Please enter your login:") 
    i - = 1 
    IF zh == username: 
        mm = the INPUT ( "Please enter your password: ") 
        IF mm == password: 
            Print (" verification is successful landing ...... "). 
            Print ( '' 'Congratulations on your successful landing! 
            Welcome to the user to enter 
            a user name:% s 
            password:% s 
            '' '% (zh, mm)) 
            BREAK 
        the else: 
            IF i == 0: 
                Print ( "!! you did not have the chance to see the next game over") 
                answer the INPUT = ('? N or try again the Y-') 
                IF answer == 'Y':
                    i = 3
            print ( "Wrong password, please re-enter") 
            print ( "You have" + str (i) + "chance") 
    the else: 
        print ( "! Please enter the correct user name") 
        IF i == 0: 
            Print ( "you did not have the chance!") 
            answer the INPUT = ( 'N or re-try the Y-?') 
            IF answer == 'the Y-': 
                i = 3 
        Print ( "you have" + str (i) + " chance ") 
the else: 
    Print ( 'TM you want to shameless')

  

Guess you like

Origin www.cnblogs.com/zhc1654094124/p/11040328.html
Recommended