Movie Reading and Rate Updating

  • Load the pickled movie file (it is a standard python object)
  • Load in the ratings from the text file (open up file to determine separator)
    • Must have error handling for the entries where the ratings are malformed, output the user who entered the bad data (see below...must use try:except block)
  • Parse the ratings and update the movie object (ratings and number of ratings)
  • Calculate a new average for every movie
  • Organize the movies into a new list based on the highest rating first, lowest rating last
  • Save the organized list of movies (dictionary objects containing the title, year, and new rating only) as a new pickled file (organized_movies.p)
  • Output the highest and lowest dictionary objects

Movies Loaded
worldlyCow9's rating is non numeric
blissfulTermite9's rating is non numeric
cautiousRhino6's rating is non numeric
Ratings Loaded
Highest rated movie:  {'title': 'The Wild Bunch', 'year': 1969, 'rating': 7.98304347826087}
Lowest rated movie:  {'title': 'Casino', 'year': 1995, 'rating': 6.973243243243243}
New File Saved

Need a custom answer at your budget?

This assignment has been answered 6 times in private sessions.

© 2024 Codify Tutor. All rights reserved