Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Looking for help with my python question thank you Enter the name: Kelly Name: Kelly Phone: 4344345 Email: kelly@bmail.com 1. Look upa contact 2. Add
Looking for help with my python question
thank you
Enter the name: Kelly Name: Kelly Phone: 4344345 Email: kelly@bmail.com 1. Look upa contact 2. Add a new contact 3. Change an existing contact 4. Delete a contact 5. Display all contacts 6. Quit the program Enter your choice: 1 Enter the name: James James is not found in the phone book. 1. Look upa contact 2. Add a new contact 3. Change an existing contact 4. Delete a contact 5. Display all contacts 6. Quit the program Enter your choice: To achieve the above task, you need to implement the find a record ), display_a record) and search a recordQ functions inside the PhoneBook class. The find_a_record(self, name) function locates the contact record that matches the given name from its parameter. The function returns the Contact object has the same name, or the value None if no matching record was found. item) function prints out a contact record in the format illustrated The display a record (self, in the above example. The search a record(self) fulfills the function of searching for a contact record with an user input name. The function requests for an user input, then it makes use of the find a record () to determine whether the input name exists in the phone book or not. If a matching name is found, it will make use of the display a record) function to print out the contact record. Otherwise, if no matching name found, it prints out the not-found message. The sample input/output are shown in the above exampleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started