Objective
pickle serializes almost any Python object to bytes and rebuilds it later. It is handy between your own programs, but you must never load a pickle that comes from an untrusted source: loading it can run code.
Instructions
- The first line has the number
nof people; each one is a linename age. - Store in a dictionary the list
peopleof tuples and the dictionaryages. Serialize it withpickle.dumpsand recover it withpickle.loads. - Show
Equal copy: True,Different object: True(the copy is not the same object) and the people of the copy sorted by age and then by name.
3
ana 30
luis 25
eva 30
Equal copy: True
Different object: True
luis 25
ana 30
eva 30
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise