In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the python how to achieve the member management system related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this python how to achieve the member management system article will have a harvest, let's take a look at it.
The details are as follows:
Backstage administrator foreground member information system 1. The background administrator has only one user: admin password: admin2. When the administrator has successfully logged in, you can manage the front desk member information 3. When member information management includes: add member information delete member information view member information exit add user: 1) judge whether the user exists 2) if it exists, report an error 3) if it does not exist, add a user name and password to the list to delete the user: 1) determine whether the user exists 2) if it does not exist, delete 3) if it does not exist Error "" print ('administrator's login interface' .center (50 root','frost' login')) # effect is 25 left and right 25 each * surround the management login-free interface in the middle # initialize membership information users = ['root','frost'] passwd = [' 123' '000'] # receive login information User = input ("Please enter login name:") Passwd = input ("Please enter password:") if User = 'admin': if Passwd = =' admin': print ("login successful!") While True: # use while True loop statement: the core idea of using this statement is that if there is an error, you can continue to loop print ("operation directory: 1. Add member information 2. Delete member information 3. View member information 4. Exit "") option = input ("Please enter your Operand number") if option = "1": print ("* add member information *") adduser = input ("user name:") addpasswd = input ("password:") If adduser in users: print ("add failed User name exists! ") Else: users.append (adduser) # .append () adds a new object passwd.append (addpasswd) print ('added successfully!') to the end of the list Elif option = '2delete: print ("* delete member information *") deluser = input ("member name:") if deluser not in users: print ("deletion failed, the user% s information does not exist!" % (deluser)) else: # find the index value corresponding to the user to be deleted delindex = users.index (deluser) users.remove (deluser) # .remove () is the first match passwd.pop (delindex) # .pop () used to remove a value from the list ) function to remove an element print from the list ("deleted successfully!") Elif option = '3users: print ("* View member information *") # Statistics the length of the users list, that is, the number of users in the table count = len (users) for i in range (0 Count): print ("user name:% s password:% s"% (users [I], passwd [I]) elif option = = '4commands: exit () else: print ("Please enter the correct instruction!") Else: print ("% s login failed: wrong password!" % (User)) else: print ("% s user does not exist!" % (User))
Running result:
This is the end of the article on "how to implement the member management system in python". Thank you for your reading! I believe that everyone has a certain understanding of the knowledge of "how to implement the member management system in python". If you want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.