Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions