Python-List Application-name management system and python-Management System

Source: Internet
Author: User

Python-List Application-name management system and python-Management System

Code:

1 #1 print function prompt 2 print ('=' * 50) 3 print ('name relational system v1.0') 4 print ('1: Add a new name ') 5 print ('2: delete a Name') 6 print ('3: change a Name') 7 print ('4: query a Name') 8 print ('5: exit System ') 9 print (' = '* 50) 10 names = [] # define an empty list to store the added name. 11 #2 get the user selected 12 while True: 13 num = int (input ('enter function No.: ') 14 #3. Based on your selection, execute the corresponding function 15 if num = new_name = input ('Enter the name: ') 17 names. append (new_name) 18 print (names) 19 elif num = del_name = input ('enter to delete Except the name ') 21 names. remove (del_name) 22 print (' deleted! ', Names) 23 elif num = old_name = input ('Enter the name to modify:') 25 update_name = input ('enter the modified value :') 26 index = names. index (old_name) 27 names [index] = update_name28 print ('modification complete! ', Names) 29 elif num = find_name = input ('Enter the name to query:') 31 if find_name in names: 32 print ('found the person you are looking for ') 33 else: 34 print (' no such person found! ') 35 elif num = break37 else: 38 print (' incorrect input! ') 39 continue

 

Thoughts:

Today, I will review the application of the list. Use a name management system to add, delete, modify, and query lists!

Use a Summary of the usage of the list:

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.