The implementation is as follows:
Def login (): While true: username = input ("enter username:") if username not In passwd. keys () or username = ": Print (" the user name does not exist. Enter the correct user name ") else: Print (" User Name passed ") break I = 1 while I <4: Password = input ("please continue to enter the User Password:") if passwd [username]! = Password: If I <3: Print ("Incorrect password, you still have % d chance" % (3-I) I + = 1 else: print ("the number of opportunities has been used up! ") Break if passwd [username] = password: Print (" password passed, login successful ") break # print (" the opportunity has been used up, quit the system ") if _ name _ = '_ main _': passwd = {'admin': '000000', 'user1': '000000'} login ()
(UI): design a logon program. Different user names and passwords are stored in a dictionary ...... the details are as follows: