Page 1 of 1

use Python, please help!

Posted: Fri Jul 01, 2022 5:41 am
by answerhappygod
use Python, please help!
Use Python Please Help 1
Use Python Please Help 1 (51.96 KiB) Viewed 45 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