Question: Define a function named add _ contact to meet the following requirements: Take a contact dictionary as a positional parameter. Take a id as a

Define a function named add_contact to meet the following requirements:
Take a contact dictionary as a positional parameter.
Take a id as a keyword parameter.
Take a first_name as a keyword parameter.
Take a last_name as a keyword parameter.
If the id exists in the dictionary, return the string error.
Append the id:[first_name, last_name] key:value pair to the contact dictionary.
Return the key:value pair that was added.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!