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: