Python: Business Card management System

Source: Internet
Author: User

The string and the list are finished,

I tried to write a very simple card management system,

New Meng Try,

Don't spray the big boys,

Modify the function of a business card I stole a lazy,

Because I don't know how to define the subscript and then use the subscript to modify the string in the list.

My idea is that the user ready to modify the business card to delete, and then the user new name of the business card can be added;

If there is a way for the big guy to change directly, please give me a hint ...

The code is as follows:

1Name = []2  whileTrue:3     Print("="*50)4     Print("Welcome to the card management system V1.0")5     Print("1: Add a business card")6     Print("2: Modify a business card")7     Print("3: Delete a business card")8     Print("4: Query a business card")9     Print("5: Exit")Ten     Print("="*50) Oneadmin = Int (input ("Please enter the function number:")) A  -     ifadmin = = 1: -          whileTrue: theNew_name = input ("Please enter your name:") -             ifNew_name = ="return": -                  Break - name.append (new_name) +             Print("=======> added successfully! ") -             Print("=======> has now been added with the name:%s"%(name)) +             Print("=======> return Menu Please enter: Return") A     elifadmin = = 2: at          whileTrue: -Al_name = input ("Please enter the name you want to change:") -             ifAl_name = ="return": -                  Break -             ifAl_nameinchName: -Als_name = input ("Please enter a new name:") in Name.remove (al_name) - name.append (als_name) to                 Print("=======> 's current name is:%s"%(name)) +             Else: -                 Print("The name you entered does not exist, please re-enter! ") the             Print("=======> return Menu Please enter: Return") *     elifadmin = = 3: $          whileTrue:Panax NotoginsengDel_name = input ("Please enter the name you want to delete:") -             ifDel_name = ="return": the                  Break + Name.remove (del_name) A             Print("=======> Delete Success! ") the             Print("=======> currently has the remaining name:%s"%(name)) +             Print("=======> return Menu Please enter: Return") -     elifadmin = = 4: $          whileTrue: $Look_name = input ("Please enter the name you want to query:") -             ifLook_name = ="return": -                  Break the             Else: -                 ifLook_nameinchName:Wuyi                     Print("the name you want to query exists! ") the                 Else: -                     Print("no such person! ") Wu             Print("=======> return Menu Please enter: Return") -     elifadmin = = 5: About          Break $     Else: -         Print("your input is wrong, please enter it again! ")

Python: Business Card management System

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.