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.
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")) 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started