1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gregori [183]
3 years ago
6

A friend of Kenneth's invited him to a party but forgot to give him the address. Luckily, Kenneth is very organized and has two

dictionaries, one that contains names and phone numbers; and another one that contains phone numbers and addresses. However, Kenneth needs your help to make it easier to find an address from a name. To achieve this, you will create a function called phone2address that takes three parameters:
⢠the first one is a dictionary that has names as keys and phone numbers as values
⢠the second one is a dictionary that has phone numbers as keys and addresses as values;
⢠the third one is a string with a friend's name.

To complete this function, you need to:

⢠First, use the phonebook and friend's name to find the desired phone number) .
Second, use the phone number and address book to find the correct address;
⢠Finally, you should return the address.
Computers and Technology
1 answer:
gregori [183]3 years ago
4 0

Answer:

Explanation:

The following code is written in Python and creates the function as requested in the question...

def phone2address(phonebook, addressBook, friendName):

   phoneNumber = phonebook.get(friendName)

   address = addressBook.get(phoneNumber)

   return address

The function uses the dictionary (phonebook) to look for the friendName input as the key and then saves the phone number attached to that name in a variable called phoneNumber. Then we use that variable to search the addressBook dictionary to find the associated address and save it to the address variable. Finally, we return that address.

You might be interested in
How many instructions can the microprocessor execute each second if the assembly line is present?
SpyIntel [72]

The instructions that he microprocessor can execute each second if the assembly line is present will be depending on the workload and the architecture’s core because it is all depending on the speed of the CPU and the multiplier that it acquires.

3 0
3 years ago
Small programs called _______ are used to communicate with Paris Friel devices such as monitors printers portable storage device
algol13

the answer is D drivers

7 0
3 years ago
It's best to use assertive speech when you<br> I want to show respect. *<br> True<br> False
mestny [16]

Answer:

True

Explanation:

Hope this helps :)

6 0
3 years ago
Read 2 more answers
Jhon bought a new printer for his desktop computer. It does not work even though he checked all the cables and cords. What do yo
ExtremeBDS [4]
Im not for sure but it might be B or C
4 0
3 years ago
Read 2 more answers
Legal counsel has notified the information security manager of a legal matter that will require the preservation of electronic r
Ray Of Light [21]

Answer: (B) Legal hold

Explanation:

As being a security director, the security director are approached to solidify a server that run the red hat enterprise server the 5.5.

The servers are being utilized as DNS (Dynamic host service) and the server time. This is not utilized as the database, print server and the web server. There is no particular remote associations with the server.

The window of the command will be given the root accessing. Then, it provide the associated by means of a protected shell with the access root in the system.

 

3 0
3 years ago
Other questions:
  • PLEASE HELP ITS DRIVERS ED
    8·2 answers
  • What are the two main functions of user accounts in Active Directory? (Choose all that apply.) Allow users to access resources m
    7·2 answers
  • Description:
    7·1 answer
  • For this project, you'll be given information to create a business report using word processing software. Suppose you want to op
    11·1 answer
  • A system is composed of four parts, J, K, L, and M. All four must function for the system to function. The four component reliab
    6·1 answer
  • What are two options available for highlighting changes in the Highlight Changes dialog box?
    11·2 answers
  • PLEASE HELP <br> Which of the following best describes the existence of undecidable problems?
    7·1 answer
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • you are working on creating a business document with two other co-workers. Based on just information, which of the following pre
    14·1 answer
  • Which of the following is the term for a device (usually external to a computer) that is plugged into a computer's communication
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!