# I = 3
# Username = "yangxiaoer"
# Password = "123456"
# While I> = 0:
# Name = input ("Enter your Username :")
# If name = Username:
# Passwd = input ("enter your password :")
# If passwd = password:
# Print ("Logon successful. Please wait ")
# Print ('''
# Username: % s
# Password: % s
# ''' % (Username, password ))
# Break
# Else:
# Print ("Your password is incorrect. Please enter it again ")
# Print ("You still have % s chances" % (I-1 ))
# If I = 0:
# Print ('your chances are used up, end this operation ')
# Break
# Continue
# Else:
# Print ("your username is incorrect! Enter ")
# Print ("You still have % s chances" % (I-1 ))
# I-= 1
Second
Username = "yangxiaoer"
Password = "123456"
I = 3
While I> 0:
Zh = input ("enter your account :")
I-= 1
If ZH = Username:
Mm = input ("enter your password :")
If Mm = password:
Print ("Verification Successful... login ......")
Print (''' congratulations, you have logged on!
Welcome
Username: % s
Password: % s
''' % (Zh, mm ))
Break
Else:
If I = 0:
Print ("your chances are gone! See game over next time! ")
Answer = input ('try again? Y or n ')
If answer = 'y ':
I = 3
Print ("Incorrect password, please enter it again ")
Print ("You still have" + STR (I) + "opportunity ")
Else:
Print ("enter the correct user name! ")
If I = 0:
Print ("your chances are gone! ")
Answer = input ('try again? Y or n ')
If answer = 'y ':
I = 3
Print ("You still have" + STR (I) + "opportunity ")
Else:
Print ('Do you want your TM face ')
Login (three chances of losing an error) and the remaining number of errors displayed each time the error is lost (Prompt: Enable? String format)