Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

given a list following the order show_id, type, title, director, cast, country, date_added, release_year, listed_in, and description: [ [80058654, 'TV Show', 'Transformers: Robots in Disguise',

given a list following the order show_id, type, title, director, cast, country, date_added, release_year, listed_in, and description:

[ [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 taking as parameter the list given up(the list is too long to be copied entirely), beginning_year (str), ending_year (str), month (str)

that returns a sorted list of tuples composed of the movies/TV shows within cleaned_list. The parameter beginning_year denotes the first year of date_added that you should begin including (inclusive), while the parameter ending_year denotes the final year you should include (inclusive). You should only include movies/TV shows that were added in the same month as the month parameter. If a movie/TV shows added date is None, you should exclude it from the list. The format of each tuple should be as follows:

date_added - the 0th element (str)

show_id - the 1st element (int)

title - the 2nd element (str)

Your returned list should be sorted based on the date_added in chronological (ascending) order. If 2 or more movies/TV shows have the same month-date combination, you should then sort based on the title column in ascending order. You may assume beginning_year < ending_year.

the result should be as follow:

added_date(cleaned_list, '2014', '2018', 'jaNuARy')

>>[ ('01-24-2014', 70296733, 'Mitt'), ('01-01-2016', 70213235, 'Mighty Morphin Alien Rangers'), ('01-01-2016', 70221673, 'Power Rangers Samurai'), ('01-01-2017', 80158376, 'An American in Madras'), ('01-01-2017', 80117742, 'Hurricane Bianca'), ('01-01-2017', 80147318, 'Radiopetti'), ..., ('01-09-2018', 80233024, 'The House Next Door'), ('01-15-2018', 80168300, 'Unrest'), ('01-16-2018', 70114021, 'A Serious Man') ]

added_date(cleaned_list, '2014', '2018', 'ocTober')

>>[ ('10-01-2017', 70136140, 'Star Trek'), ('10-12-2018', 80178943, 'The Boss Baby: Back in Business'), ('10-16-2018', 70301553, 'Rake') ]

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_2

Step: 3

blur-text-image_3

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

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions

Question

The collector agent ignores any login events that match the....

Answered: 1 week ago