JSON Flashcards
What is JSON?
JSON stands for Javascript Object Notation. It’s actually independent of Javascript. It is a standardized format that is commonly used to transfer data.
True or False. JSON is similar to Python dictionaries.
True. However, JSON does not require indentation the way that Python dictionaries do.
What does serialization mean? Provide an example
encoding data into JSON format. An example would be converting a Python list into JSON
What does deserialization mean? Provide an example
decoding data into JSON format. An example would be converting JSON into a Python list
What are the two major functions to serialize data? What are their differences?
dump() and dumps(). dump() is used to write data to a file like object (in a with block). dumps() serializes data into a string.
What are the two major functions to deserialize data? What are their differences?
load() and loads(). load() is used to read data from a file like object. loads() deserializes json data into a string.