Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Program The contact list must be stored in a Python list of tuples, as above, always sorted alphabetically on the name field. An empty

Python Program

image text in transcribed

image text in transcribed

The contact list must be stored in a Python list of tuples, as above, always sorted alphabetically on the name field. An empty contact list is represented by the empty list [1. For your solution to get any credit do NOT use dictionaries. a) Write a function that adds a contact to a contact list. If the contact name existed before in the list then it will be changed to the new entry and the function returns False. Otherwise, the function should return True. b) Write a function that removes a contact from a contact list. If the contact name existed before in the list then the function returns True. Otherwise, the function should return False. c) Write a function that finds a contact tuple from a contact list by passing the contact name or contact. Use default parameter values to deal with this choice. The function returns the tuple if the contact is found and returns None otherwise. d) Write a function that saves a contact list to a.CSV file. The function takes as parameter the file name. The CSV file format must have name, nickname, phone# on a line for each contact in the list. e) Write a function that reads a contact list from a.CSV file with the format described for part d). The function takes as parameter the file name and returns the contact list object sorted alphabetically). f) Write a main function that tests all the functions above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions