Question: 2. Write a Python program that asks the user for two strings: (1) the name of a file formatted in the same way as the

 2. Write a Python program that asks the user for two

2. Write a Python program that asks the user for two strings: (1) the name of a file formatted in the same way as the IMDB data, and (2) a string that is the start of a last name. The program should output the number of different last names that are in the file and it should output the number of different names that start with the string. Your program mustuse a set and you may/are encouraged to start from the code written during lecture. We define a last name to be everything up to the first comma in the name. (Some names will not have commas in them, and be careful to avoid adding empty last names to the set.) For example, Downey 3r., Robert I Back to School 1986 Downey Sr., Robert I Moment to Moment | 1975 Downey, Elsie I Moment to Moment I 1975 would result in three different last names, Downey r. Downey Se. and Downey Here is one example of running our solution Data file name: imdb/imdb data.txt Prefix: Down 48754 last names 10 start with Down Before uploading your Python file to Submitty you should test using the data files (or restricted versions of them!) we provided for Lecture 15 on the Piazza page. On Submitty we will test with different files and examples

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!