A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes in word pairs that consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Ex: If the input is: Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309 Пнап.ру 1 user_input input() user_input.split() dict(pair.split(':') for pair in entries) 2 entries 3 contact_list %3D

Question

The coding language is python

 

The code in there may or not be correct I was playing around with it 

 

Chapter was on lists and dictionaries 

A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address,
birthday, etc. Write a program that first takes in word pairs that consist of a name and a phone number (both strings). That list is followed
by a name, and your program should output the phone number associated with that name.
Ex: If the input is:
Joe 123-5432 Linda 983-4123 Frank 867-5309
Frank
the output is:
867-5309
View transcribed image text
Expand
Пнап.ру
1 user_input
input()
user_input.split()
dict(pair.split(':') for pair in entries)
2 entries
3 contact_list
%3D
View transcribed image text
Expand

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the...

A: Program: //include the header file import java.util.Scanner;   //definition of class public class Si...

Q: Identify and briefly describe the five basic approaches to task management employed in operating sys...

A: The five basic approaches to the task management employed in the operating systems: Multiuser Mul...

Q: In the context of DES cipher, what is the output of this "S-box" if the bits in input are: 011000 00...

A: S-box stands for Substitution-box. The output of the given S-box can be found by the following step,...

Q: Code an application that determines how many gallons of water is needed for a pool. Create Void Meth...

A: The program calculates the gallons of water required for completely filling the pool as per user des...

Q: When would you be most likely to use an abstract class? when you need to derive a class from Objec...

A: An abstract class is most likely to be used when a superclass is required that should be not be inst...

Q: Use the library and Internet to find information about distributed systems architectures. Describe ...

A: Distributed system: The distributed system is a collection of nodes or networked computer which com...

Q: Write a statement that outputs variable userAge. End with a newline. Program will be tested with dif...

A: Program: //import the header file import java.util.Scanner;   //definition of "VariableOutput" class...

Q: Creating new system using object oriented approach of a real estate brokerage firm

A: Object-oriented approach is a methodology which is based on concepts of object, inheritance, class, ...

Q: 2. Complete the following conversions: A. Change following Hexadecimal to Binary for: (5F3D)16 B. Ch...

A: Hexadecimal number system: In hexadecimal number system, the numbers from “0” to “9” and letters fr...

Transcribed Image Text

A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes in word pairs that consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Ex: If the input is: Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309

Пнап.ру 1 user_input input() user_input.split() dict(pair.split(':') for pair in entries) 2 entries 3 contact_list %3D