Question: create a program in python using the following: Program Specifications Provided to you is a file called Movies . txt in which each line is
create a program in python using the following:
Program Specifications Provided to you is a file called Moviestxt in which each line is of the form: Name of Actor, Movie Movie Movie High Level Algorithm Read in the lines from the moviestxt file. For each line: a If the movie name has not already been entered into the dictionary, add it as a key, and store the name of the actor as a value. b If the movie name exists in the dictionary, add the actors name to the set of actors ie to the value in the dictionary. The dictionary is now ready. Show a menu to the user and allow himher to choose an option amongst: a Give me movies separated by & b Give me name of an actor and find hisher coactors If the user goes for option a above, prompt himher for the names of the movies separated by & Perform the corresponding set operations and display the result. If the user selects option b above, prompt for the name of the actor. Show the results indicating names of the coactors. print out the results to a txt file you do not need to write out the dump option End Remember that you have to use functions in this project at least of them; more would be appreciated. Eg Building a dictionary, finding coactors etc. each could be represented by a function. Bottom line is that Try to use functions wherever possible as they carry points
The following output should be similar:
Enter "movies" to work with movies Enter "actors" to work with actors Enter "dump" for the movieactors dictionary not required Enter "quit" to quit Do what:movies Give movie names separated by union&intersection or symmetricdiff :Wild Wild West Million Dollar Baby Search Query : Wild Wild West Million Dollar Baby Morgan Freeman', 'Salma Hayek', 'Will Smith' Enter "movies" to work with movies Enter "actors" to work with actors Enter "dump" for the movieactors dictionary not required Enter "quit" to quit Do what:actors Looking for all the coactors of what actor exact name :Will Smith CoActors of Actor Will Smith Salma Hayek' Enter "movies" to work with movies Enter "actors" to work with actors Enter "dump" for the movieactors dictionary not required Enter "quit" to quit Do what:dump A Beautiful Mind:Russell Crowe' A Few Good Men:Kevin Bacon', 'Tom Cruise' Ace Ventura:Jim Carrey' American Gangster:Russell Crowe', 'Denzel Washington' Apollo :Tom Hanks' Assassins:Sylvester Stallone', 'Julianne Moore' Blood Diamond:Leonardo Di Caprio' Bone Collector:Angelina Jolie', 'Morgan Freeman', 'Denzel Washington' Bounce:Gwyneth Paltrow', 'Ben Affleck' Bourne Identity:Matt Damon' Bourne Ultimatum:Matt Damon' Bruce Almighty:Morgan Freeman', 'Jim Carrey' Catch Me If You Can:Tom Hanks', 'Leonardo Di Caprio' Cinderella Man:Renee Zellweger', 'Russell Crowe' Desperado:Salma Hayek', 'Antonio Banderas' Die Hard:Bruce Willis' Edward Scissorhands:Johnny Depp' Finding Neverland:Kate Winslet', 'Johnny Depp' Gladiator:Russell Crowe' Good Will Hunting:Matt Damon', 'Ben Affleck' Hannibal:Julianne Moore', 'Anthony Hopkins' Hitch:Will Smith' Intolerable Cruelty:Catherine Zeta Jones', 'George Clooney' Jerry Maguire:Renee Zellweger', 'Tom Cruise' Lara Croft Tomb Raider:Angelina Jolie' MeMyself & Irene:Renee Zellweger', 'Jim Carrey' Meet Joe Black:Anthony Hopkins', 'Brad Pitt' Men in Black:Will Smith' Million Dollar Baby:Morgan Freeman' Mission Impossible:Tom Cruise' Mr & Mrs Smith:Angelina Jolie', 'Brad Pitt' National Treasure:Diane Kruger' Oceans Eleven:George Clooney', 'Julia Roberts', 'Brad Pitt' Pearl Harbor:Alec Baldwin', 'Ben Affleck' Pretty Woman:Julia Roberts' Proof:Gwyneth Paltrow', 'Anthony Hopkins' Pulp Fiction:Bruce Willis' Pursuit of Happyness:Will Smith' Rambo:Sylvester Stallone' Rocky:Sylvester Stallone' Runaway Bride:Julia Roberts' Seven:Morgan Freeman', 'Brad Pitt' Shakespeare in Love:Gwyneth Paltrow' Sleepers:Kevin Bacon', 'Dustin Hoffman', 'Brad Pitt' Sleepless in Seattle:Tom Hanks', 'Meg Ryan' The Departed:Matt Damon', 'Leonardo Di Caprio' The Edge:Alec Baldwin', 'Anthony Hopkins' The Lost City:Dustin Hoffman' The Mask:Jim Carrey' The Mask of Zorro:Catherine Zeta Jones', 'Antonio Banderas' The Pirates of Caribbean:Johnny Depp' The Siege:Bruce Willis', 'Denzel Washington' The Sixth Sense:Bruce Willis' Titanic:Kate Winslet', 'Leonardo Di Caprio' Top Gun:Tom Cruise' Troy:Diane Kruger', 'Brad Pitt' Wild Wild West:Salma Hayek', 'Will Smith' You have got mail:Tom Hanks', 'Meg Ryan' Enter "movies" to work with movies Enter "actors" to work with actors Enter "dump" for the movieactors dictionary not required Enter "quit" to quit Do what:quit
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
