1. Number of account password input
Condition: 1, enter user password
2. Display welcome information after successful authentication
3, the wrong three times after the lock
User= "Pengchun"
Password= "Pcwangjixuan"
f = open (' User.log ', ' R ')
Lock_file = F.read ()
F.close ()
Count = 0
For I in range (3):
User1=input ("Please input your name:")
Password1 = input ("Please input your passwor:")
For j in Range (1):
if Lock_file = = User1:
Print ("The account is locked")
Exit ()
Else
Continue
if user = = User1 and Password = = Password1:
Print ("Verification succeeded")
Break
Else
If i==2:
Print ("You have tried too many times and the system automatically exits")
Else
Print ("Login failed, please re-enter")
Count +=1
if Count = = 3 and User1! = "Pengchun":
Print ("You are using more than 3 users and the system is about to be locked")
f = open ("User.log", "W")
F.write ("%s"%user1)
F.close ()
2. Multi-level menu
1. Number of password entries 2, multi-level menu