Question: this is programming 271 python and please put a screen shot of your input and output with the answer 9.10 LAB: Sorting TV Shows (dictionaries

9.10 LAB: Sorting TV Shows (dictionaries and lists) Write a program that first reads in the name of an input file and then read the input file using the file readines) method. The input file contains an unsorted list of number of seasons followed by the corresponding TV show. Your program should put the contents of the input file into a dictionary where the number of seasons are the keys, and a list of TV shows are the values (since multiple shows could have the same number of seasons) Sort the dictionary by key (least to greatest) and output the results to a file named output keys.txt, Separate multiple TV shows associated with the same key with a semicolon C), ordering by appearance in the input file. Next, sort the dictionary by values (alphabetical order), and output the results to a file named output_titles.tct. Ex If the input is: lel.txt and the contents of file1.Det are 20 Gunsmoke 30 The Simpsons 10 W Grace 14 Dallas 20 Law & Order 12 Murder, She Wrote the file output keys be should contain W111 & Grace 14 Dallas 20 Law & Order 12 Murder, She Wroto the file output keys. Dxt should contain: 10: W111 Grace 12: Murder, She Wrote: 14. Dallas 201 Gunsmokes Law & Order 30: The Simpsons and the file output_titles bxt should contain Dallas Gunsmoke Law & Order Murder, She Wrote The Simpsons Will 5 Grace Note There is a newline at the end of each output file, and file1.txt is available to download
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
