Question: I am working in python and I have a file, review.txt, that contains a dictionary inside a dictionary. The information are reviews for a number

I am working in python and I have a file, review.txt, that contains a dictionary inside a dictionary. The information are reviews for a number of movies by a number of reviewers. how would i read in the values and store this information in python using dictionaries?

review.txt

{'Nancy Pollock': {'Lawrence of Arabia': 2.5, 'Gravity': 3.5, 'The Godfather': 3.0, 'Prometheus': 3.5, 'For a Few Dollars More': 2.5, 'The Guns of Navarone': 3.0},'Jack Holmes': {'Lawrence of Arabia': 3.0, 'Gravity': 3.5, 'The Godfather': 1.5, 'Prometheus': 5.0, 'The Guns of Navarone': 3.0, 'For a Few Dollars More': 3.5}, 'Mary Doyle': {'Lawrence of Arabia': 2.5, 'Gravity': 3.0, 'Prometheus': 3.5, 'The Guns of Navarone': 4.0},'Doug Redpath': {'Gravity': 3.5, 'The Godfather': 3.0, 'The Guns of Navarone': 4.5, 'Prometheus': 4.0, 'For a Few Dollars More': 2.5},'Jill Brown': {'Lawrence of Arabia': 3.0, 'Gravity': 4.0, 'The Godfather': 2.0, 'Prometheus': 3.0, 'The Guns of Navarone': 3.0, 'For a Few Dollars More': 2.0}, 'Trevor Chappell': {'Lawrence of Arabia': 3.0, 'Gravity': 4.0, 'The Guns of Navarone': 3.0, 'Prometheus': 5.0, 'For a Few Dollars More': 3.5},'Peter': {'Gravity':4.5,'For a Few Dollars More':1.0,'Prometheus':4.0}}

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!