Implement the following functions:
- code should be in python
Extracted text: The load_contact_list Function You will first implement the load_contact_list function, which should take in one argument, the name of the file to load. This function should read the contact list file that is passed in, store the contents into a dictionary of dictionaries, and return that dictionary. • The higher-level dictionary should contain the names as its keys. • Each entry in the higher-level dictionary should contain 3 entries with the keys email, phone, and address. The values for each of these dictionaries should be filled according the content loaded from the lists. For example, consider the sample file containing the following few lines: Sandy Cheeks,
[email protected], 831-507-8282, 157 Dome Drive Perry Platypus,
[email protected], 510-339-2102, 7211 Tristate Alley Ino Yamanaka,
[email protected], 415-988-2341, 98 Konoha Lane The following code should produce the following results (displayed output is italicized). contact_list_dict = load_contact_list('sample_contact_list.txt') print(contact_list_dict['Sandy Cheeks']) {'email': 'cheeks@ucsc. edu', 'phone': '831-507-8282', print(contact_list_dict['Ino Yamanaka']['email'] telekineticflower@ucsc. edu 'address': '157 Dome Drive'} Keep in mind that content values must be trimmed of surrounding whitespaces.
Extracted text: Helper Functions You will also implement the following helper functions that use the dictionary returned from the load_contact_list function you implement. The first argument of each of these functions will be the contact list dictionary. This is necessary so these helper functions have the dictionary in their scope. • get_email: The second argument is a name. This function returns the email of the specified contact. If contact is not found, this function must print an error and return None. • get_phone: The second argument is a name. This function returns the phone number for the specified contact. If contact is not found, this function must print an error and return None. get_address: The second argument is a name. This function returns the address for the specified contact. If contact is not found, this function must print an error and return None. get_email_list: The second argument is a list of names. This function returns a list of emails for all specified contacts. If one of the contacts is not found, this function must print an error message (that includes the name of the contact not found) and not include a value for that missing contact in the list that is returned. • get_phone_list: The second argument is a list of names. This function returns a list of phone numbers for all specified contacts. If one of the contacts is not found, this function must print an error message (that includes the name of the contact not found) and not include a value for that missing contact in the list that is returned. get_address_list: The second argument is a list of names. This function returns a list of addresses for all specified contacts. If one of the contacts is not found, this function must print an error message (that includes the name of the contact not found) and not include a value for that missing contact in the list that is returned. Requirements 1. Your program must implement all the functions (load_contact_list and the helper functions) listed above. Your implemented functions must have the same name as the descriptions above, or you will lose points. 2. Each function you implement must follow the descriptions provided above.