Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am creating a contact book in Python. Each contact is a tuple of the name, the phone number, and the address of contacts. For
I am creating a contact book in Python. Each contact is a tuple of the name, the phone number, and the address of contacts. For example:
("Johnny", "555-4782", "1200 Van Ness Avenue") ("Mark", "555-6411", "1343 Guerrero Street") ("Lisa", "555-5438", "1200 Van Ness Avenue") ("Denny", "555-3515", "1200 Van Ness Avenue")
I need a container type that will store these tuples. The ideal container would make it simple to retrieve a contact tuple given the phone number (assume the phone "number" is a stored as a str), preferably without writing any kind of loop.
Select the best built-in Python container type for this task.
Select one:
a. list
b. dict
c. set
d. tuple
Step 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