import pickle favorite_color = { "lion": "yellow", "kitty": "red" } with open( "save.p", "wb" ) as f: pickle.dump( favorite_color, f) with open( "save.p", "rb" ) as f: favorite_color = pickle.load(f)