Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IN PYTHON: A college gives full scholarship to every player in its football team

ID: 3860452 • Letter: I

Question

IN PYTHON:

A college gives full scholarship to every player in its football team and men's basketball team. The coach of each team gives the name of every player to the athletic director. The athletic director needs a program to handle the names. He wants the program to tell him how many scholarships they need to give out this year. What data structure in Python is the best choice to store player names? [Note: a student who plays both sports only needs one scholarship]

A list for football players and a list for basketball players

A tuple for football players and a tuple for basketball players

A dictionary for football players and a dictionary for basketball players

A set for football players and a set for basketball players

A.

A list for football players and a list for basketball players

B.

A tuple for football players and a tuple for basketball players

C.

A dictionary for football players and a dictionary for basketball players

D.

A set for football players and a set for basketball players

Explanation / Answer

Answer:- The answer of your question is D

The best suitable data structure to store the player name is is SET because set is a ordered data structure and all the entries on the data structure are unique means don't be repeated and all the entries are act as a primary key to the data structure .

List are simple array data structure so it is not a suitable data structure for your requirement.

Touple is also a simple array data structure but it can be accessed fast but touole is also not suitable

Dictionary are the unordered data structure which has two things a key and a value due to it is unordered and the key it is not suitable data structure and the entries are not unique so,

the suitable data structure is the set which has all the entries are unique which fulfill the condition of the player which play both game should have the name on the data structure only once so

Set is the suitable data structure .

Thank You Kindly rate my answer.