Question: Python question: Suppose you have a dictionary of dictionaries, or a 2D dictionary, called banditos as follows: alonzo = {age: 10, height: 42, weight: 175,

Python question:

Suppose you have a dictionary of dictionaries, or a 2D dictionary, called banditos as follows: alonzo = {"age": 10, "height": 42, "weight": 175, "instrument":"fiddle" }

turing = {"age": 41, "height": 70, "weight": 160, "instrument": "theremin"}

bertha = {"age": 32, "height": 97, "weight": 587, "instrument": "cello"}

tinkerB = {"age":100, "height": 4, "weight": 0.5, "instrument": "cello"}

banditos = {"Alonzo": alonzo, "Turing": turing, "Bertha": bertha, "TinkerB": tinkerB}

We can access the sub-dictionary, or vector, of Alonzo's attributes as follows: banditos["Alonzo"] {"age": 10, "height": 42, "weight": 175, "instrument ": "fiddle" }

We can also return a specific feature of Alonzo's as: banditos["Alonzo"]["age"] 10

For the above dictionary, banditos, write a function that, when given the dictionary, returns a list of users who play a certain instrument. E.g., here's a sample run and its result: find_players(banditos, "cello") ["Bertha", "TinkerB"]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!