A simple Python business card management system,

Source: Internet
Author: User

A simple Python business card management system,

After learning about strings and lists, I tried to write a very simple Python business card management system.

Try xinmeng. Don't try it.

I am a little lazy about modifying the business card function, because I don't know how to define the subscript and then modify the strings in the list through the subscript.

My idea is to delete the business card that the user is about to modify, and then add the new name to the business card;

If you have a direct modification method, please give me some advice.

The Code is as follows:

Name = [] while True: print ("=" * 50) print ("Welcome to business card management system V1.0") print ("1: Add a business card ") print ("2: modify a business card") print ("3: delete a business card") print ("4: query a business card") print ("5: Exit ") print ("=" * 50) admin = int (input ("Enter function No.:") if admin = 1: while True: new_name = input ("enter your name:") if new_name = "return": break name. append (new_name) print ("======> added successfully! ") Print (" ======> currently added names include: % s "% (name )) print ("======> return menu, enter: Return") elif admin = 2: while True: al_name = input ("Enter the name you want to modify:") if al_name = "return": break if al_name in name: als_name = input ("enter a new name: ") name. remove (al_name) name. append (als_name) print ("======> the current names are: % s" % (name) else: print ("the name you entered does not exist, enter again! ") Print (" ======> enter: Return to the return menu ") elif admin = 3: while True: del_name = input ("Enter the name you want to delete:") if del_name = "return": break name. remove (del_name) print ("======> deleted successfully! ") Print (" ======> currently, the remaining names are: % s "% (name )) print ("======> return menu, enter: Return") elif admin = 4: while True: look_name = input ("Enter the name you want to query:") if look_name = "return": break else: if look_name in name: print ("the name you want to query exists! ") Else: print (" No such person found! ") Print (" ======> enter: Return to the return menu ") elif admin = 5: break else: print (" your input is incorrect, enter a new one! ")

For more information, see management system development.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.