Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a function reverseDict() that takes one parameter: - fansClub, a dictionary of key: value pairs, where the key is the name of a soccer

Define a function reverseDict() that takes one parameter: - fansClub, a dictionary of key: value pairs, where the key is the name of a soccer fan and the value associated with that key is the list of soccer teams he/she is a fan off. The function returns a dictionary of key:value pairs, where the key is a soccer team and the value is the list of all names of its fans.

For example, fans = {'js':['Real Madrid','Juventus','Spain'], 'john': ['Real Madrid','France'], 'Alissa':['Roma','France']}

print(reverseDict(fans))

Output:

{'Real Madrid': ['js','john'], 'Juventus':['js'], 'Spain':['js'], 'France':['john','Alissa'], 'Roma': ['Alissa']}

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

Step: 3

blur-text-image

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago