Question: (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) Write a function called area_code , with three parameters: the first, a dictionary, the

(PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON)

Write a function called area_code, with three parameters: the first, a dictionary, the second, a string (last name), and the third a string (first name). Assume that dictionary entries are of the form (lastname, firstname) : "pho-nen-umbr". For example, {("Smith", "Bob") : "400-123-1234", ("Rogers", "Alberto") : "561-125-3510"}. Your function should return the area code of the phone number corresponding to the given first and last name. If there is no person with that name in the phonebook, return -1.

(PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) (PYTHON) Write

Write a function called area code, with three parameters: the first, a dictionary, the second, a string (last name), and the third a string (first name). Assume that dictionary entries are of the form (lastname, firstname): "pho-nen-umbr". For example, f("Smith", "Bob"): "400-123-1234", ("Rogers", "Alberto"): "561-125-3510". Your function should return the area code of the phone number corresponding to the given first and last name. If there is no person with that name in the phonebook, return -1. For example: Test Result print (area_code(ft Smith", "Bob")"400-123-1234", ("RogersAlberto"561-125- 400 510", "Smith", Bob) print (area_code "Smith", "Bob"): "400-123-1234", "Rogers", "Alberto) : "561-125- 510","Souza", "JP")) 1

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!