The
string
s
in
lines
10–16
is a
serialization
of a Python
dictionary,
just as the
string
in
line
11
of
jsonlist.py
in
JSON List
was a serialization of a Python
list.
type(s) = <class 'str'>
s = {
"name": "Mark",
"age": 64,
"favorite years": [1965, 1982, 1995],
"IKEA language": {"Billy": "bookcase", "Sladda": "bike", "Klippan": "sofa"}
}
type(dictionary) = <class 'dict'>
name = Mark
age = 64
favorite years = [1965, 1982, 1995]
IKEA language = {'Billy': 'bookcase', 'Sladda': 'bike', 'Klippan': 'sofa'}
Pretty print the dictionary.
{
"IKEA language": {
"Billy": "bookcase",
"Klippan": "sofa",
"Sladda": "bike"
},
"age": 64,
"favorite years": [
1965,
1982,
1995
],
"name": "Mark"
}