JSON Flashcards

1
Q

What is JSON?

A

JSON stands for Javascript Object Notation. It’s actually independent of Javascript. It is a standardized format that is commonly used to transfer data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False. JSON is similar to Python dictionaries.

A

True. However, JSON does not require indentation the way that Python dictionaries do.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does serialization mean? Provide an example

A

encoding data into JSON format. An example would be converting a Python list into JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does deserialization mean? Provide an example

A

decoding data into JSON format. An example would be converting JSON into a Python list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two major functions to serialize data? What are their differences?

A

dump() and dumps(). dump() is used to write data to a file like object (in a with block). dumps() serializes data into a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the two major functions to deserialize data? What are their differences?

A

load() and loads(). load() is used to read data from a file like object. loads() deserializes json data into a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly