Question

Hi, can someone help me with this Python problem. Thanks

In some karate dojo (schools), you can tell the level of a student by the colour of their obi (belt). 

In this assignment, you will write a function that will reverse the student records in a dojo such that the key is the belt and the value is a list of students that have attained that belt level. 

Write a function:

dojo_reversal(entries)

which consumes a dictionary where the key is the student's first name and the value is the colour of their belt. The function should return the reversed dictionary so that the key is the belt colour and the value is a list of all students in alphabetical order who have attained that belt level.

Note: You can assume that the belt colour will always be lowercase, latin letters.

Examples:

dojo_reversal({}) => {}

entries = {'Daniel': 'blue', 'Demetri': 'yellow', 'Dusten': 'white',
           'Hawk': 'blue', 'Samantha': 'blue', 'Johnny': 'brown',
           'Miguel': 'green', 'Robby': 'green'}
dojo_reversal(entries) => {'blue': ['Daniel', 'Hawk', 'Samantha'],
                           'brown': ['Johnny'], 
                           'green': ['Miguel', 'Robby'], 
                           'white': ['Dusten'], 
                           'yellow': ['Demetri']}


0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 7 more requests to produce the answer.

3 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Hi, can someone help me with this Python problem. Thanks
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Can someone help with this problems please 1. (10 pts] Suppose that for a given term,...

    Can someone help with this problems please 1. (10 pts] Suppose that for a given term, data is collected on the types of courses that SPSCC students take with an interest in online and evening courses. Answer the following questions using the distribution of students below. Online Course No Online Course Totals Evening Course 28 42 70 No Evening Course 82 200 282 Totals 110 242 352 a. What is the probability a student is taking an online course? b....

  • Hi, can anyone please help me with this? i have no clue how to define if...

    Hi, can anyone please help me with this? i have no clue how to define if a reaction is Oxidation reduction or not. Thanks a lot OXIDATION-REDUCTION Introduction Chemists refer to reactions which involve a transfer of electrons from one reactant to another as oxidation reduction reactions of just "redox" reactions. Oxidation is defined as a loss of electron and reduction as a gain of electron by a substance during a chemical reaction. The loss of electrons by one substance...

  • Please help me with this question! It is due by midnight! I'm doing this in Visual...

    Please help me with this question! It is due by midnight! I'm doing this in Visual Studio 2019. But any others are fine as long as it can compile. I also wanted to see the results if it is compiled and QT comments as well. Please respond immediately! Description: For this homework we will use classes to model something in the real world. In this case a resistor. The colored bands on the top-most resistor shown in the photo below...

  • If someone can help me with the first table and then use the given information to...

    If someone can help me with the first table and then use the given information to figure out the diagnosis for the patient described in the second table. Please explain why you chose a certain diagnosis so I can try to gain a better understanding! Thanks in advance!:) Table 1 Region Function Structure glomerulus Bowman's capsule Cortex proximal tubule distal tubule descending loop of Henle ascending loop of Henle Medulla collecting duct renal papilla Renal pelvis ureter Date: Technician: Patient...

  • microbiology help TOT Zoo Add Page Insert Table Chart Text Shape Media Comment These questions will...

    microbiology help TOT Zoo Add Page Insert Table Chart Text Shape Media Comment These questions will serve in lieu of a lab report for Exercise 15, 16, and 17 You will find the answer to these questions in the background, procedure, results and interpretation sections of manual Exercise 15, 16, and 17, videos, Actions of Selective and Differential Media Chart, and the Principle/Theory article in homework section.) General Questions 1. What is the purpose (function) of selective media? (How does...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT