use Python, please help!

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

use Python, please help!

Post by answerhappygod »

use Python, please help!
Use Python Please Help 1
Use Python Please Help 1 (51.96 KiB) Viewed 43 times
Function Name: genreFilter() Parameters: filename (str) Returns: mapping of movies to lists of genres of that movie (dict) Description: You want to be able to easily see movies with the same genre, so you decide to cre- ate a dictionary. Given a filename to a file that contains movie data, return a dictionary that maps each genre to a list of movies that belong to that genre. >>> genreFilter('movies.txt') { 'Action': ['Spider-Man: No Way Home', 'Top Gun: Maverick', 'The Northman', 'Interceptor'], 'Animation': ['Bubble', 'Lightyear'], 'Comedy': ['The Valet', 'The Bad Guys', 'Hustle'], 'Science Fiction': ['Oblivion', 'Jurassic World Dominion', 'Morbius'], 'Fantasy': ['Doctor Strange in the Multiverse of Madness'] }
Movie data Spider-Man: No Way Home Action Jon Watts Top Gun: Maverick Action Joseph Kosinski Bubble Animation Tetsuro Araki Lightyear Animation Angus MacLane Oblivion Science Fiction Joseph Kosinski The Northman Action Robert Eggers Jurassic World Dominion Science Fiction Colin Trevorrow The Valet Comedy Richard Wong The Bad Guys Comedy Pierre Perifel Morbius Science Fiction Daniel Espinosa Doctor Strange in the Multiverse of Madness Fantasy Sam Raimi Hustle Comedy Jeremiah Zagar Interceptor Action Matthew Reilly
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply