Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

given a list: [ [80058654, 'TV Show', 'Transformers: Robots in Disguise', None, 'Will Friedle, Darren Criss, Constance Zimmer, Khary Payton, Mitchell Whitfield, Stuart Allan, Ted

given a list:

[ [80058654, 'TV Show', 'Transformers: Robots in Disguise', None, 'Will Friedle, Darren Criss, Constance Zimmer, Khary Payton, Mitchell Whitfield, Stuart Allan, Ted McGinley, Peter Cullen', 'United States', '09-08-2018', 2016, "Kids' TV", 'When a prison ship crash unleashes hundreds of Decepticons on Earth, Bumblebee leads a new Autobot force to protect humankind.'] , [70299204, 'Movie', 'Kidnapping Mr. Heineken', 'Daniel Alfredson', 'Jim Sturgess, Sam Worthington, Ryan Kwanten, Anthony Hopkins, Mark van Eeuwen, Thomas Cocquerel, Jemima West, David Dencik', 'Netherlands, Belgium, United Kingdom, United States', '09-08-2017', 2015, 'Action & Adventure, Dramas, International Movies', 'When beer magnate Alfred "Freddy" Heineken is kidnapped in 1983, his abductors make the largest ransom demand in history.'], ...]

Write a python function that take in the given list and takes in a letter and scans through all of the descriptions of movies/TV which are the last string of each sublists, You should create a list of tuples with the 0th index of the tuple being the title of the movie/TV show (str) and the 1st index of the tuple being the number of times the letter appears in the description (int). Return the top 50 results of the list sorted descending by the number of times the letter appears within the description. If 2 or more movies/TV shows have the same number of letter appearances, you should further sort them by title alphabetically descending the title are the third elements of each sublists. Capitalization of the letter parameter and the description does not matter.

as follow:

[ ('The Ultimatum', 7), ('Women of Mafia 2', 5), ('Rosario Tijeras', 5), ('Off Camera', 5), ('Lila & Eve', 5), ('Kiss the Girls', 5), ..., ('Tales by Light', 3), ('Star Trek', 3), ('Spyder', 3), ("Slobby's World", 3), ('Shrek the Musical', 3) ]

note that the list is long and could not be entirely copied here but assumed that every sublists have the same elements as the one given up

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

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

Why are habits once established so difficult to break?

Answered: 1 week ago

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago