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 addcontact to meet the following requirements:
Take a contact dictionary as a positional parameter.
Take a id as a keyword parameter.
Take a firstname as a keyword parameter.
Take a lastname as a keyword parameter.
If the id exists in the dictionary, return the string error.
Append the id:firstname, lastname 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
