Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python language Function Name: class_finder Parameters: courseDict ( dict), friendsList ( list ) Returns: goodClasses ( list ) Description: Write a function that takes in

python language

image text in transcribed

image text in transcribed

Function Name: class_finder Parameters: courseDict ( dict), friendsList ( list ) Returns: goodClasses ( list ) Description: Write a function that takes in a list of your friends and a dictionary that maps the names of different courses as strings to lists of the course rosters. The function should return a list of the courses that have at least two of your friends in them. The format of courseDict will be as follows: course1: [personi, person2, ...), course2: [personi, person2, ...), Hint: The python in operator might be useful! >>> courseDict = {"CS1301": ["Damian", "Peter", "Jasmine C.", "Jakob", "Cathy" ] , "CS2110" : ["Arushi", "Brae", "Arvin", "Cathy", "Jasmine Y.", "Caitlin"), "CS 1332": ["Damien", "Jakob", "Juliette", "Jasmine Y." "Jasmine C.", "Arvin"]} >>> friendsList = ["Damian", "Peter", "Brae", "Arushi"] >>> print(class_finder(courseDict, friendsList)) ['CS1301', 'CS2110'] >>> courseDict = {"MATH2550": ["Jakob", "Peter", "Arushi", "Anthony", "Arvin"), "PSYC1101": ["Anthony", "Peter", "Arvin", "Juliette", "Brae", "Jasmine Y."], " EAS1600": ["Anthony", "Jasmine C.", "Jakob", "Damien", "Caitlin"), "APPH1040": ["Rajit", "Peter", "Jasmine Y.", "Cathy", "Damien", "Arushi"]} >>> friendsList = ["Jakob", "Jasmine Y.", "Anthony" ] >>> print(class_finder(courseDict, friendsList)) [ 'MATH2550', 'PSYC1101', 'EAS1600']

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago