Question: This is for an intro to python class: # This program tries to write and then read back a # dictionary using the pickle module.

This is for an intro to python class:

# This program tries to write and then read back a # dictionary using the pickle module. See if you can # fix it! import pickle original_dictionary = {'a': 1, 'b': 2} with open('stored_dictionary', 'w') as pickle_file: pickle.dump(original_dictionary, pickle_file) with open('stored_dictionary') as pickle_file: new_dictionary = pickle.load(pickle_file) print(new_dictionary == original_dictionary)

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!