Question: 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
Get step-by-step solutions from verified subject matter experts
