One, blog:
Second, edit the login interface
Enter User name password
Show welcome message after successful authentication
Lock after entering three times
Three, multi-level menu
Level three Menu
Select to go to the respective sub-menu
Required Knowledge points: List, dictionary
You can exit to the previous menu at any time
Job Two:
I wrote it by myself:
#!/usr/bin/env python#-*-coding=utf-8 -*-#AUTHOR:d uwentaousername = [' Duwentao ', ' Liuxiaohui '] #存储用户名password = [' 123456 ', ' 456789 '] # Store the corresponding password locking = [] #用于锁定n = 0 #计算输入了几次while true: username = input (' Please enter user name: ') if UserName not in locking: if UserName in username: password = input (' Please enter your password: ') if password == password[username.index (username)]: print (' login successful ') &nBsp; exit () else: n = n+1 if n == 3: locking.append (UserName) print (' Username or password error, Login failed ') else: password = input (' Please enter your password: ') print ("User name or password error, Login failed") else: print ("The user has been locked down")
Operation Result:
Job Three:
Cond
Old boy Python3.5 training first week homework