The type of dictionary is dict
The type of json is str
1. The difference between json and dictionary
1. In json, except data, key and value are both strings, enclosed in double quotes; empty value is null; Boolean value is false/true (lowercase) 2. Dictionary, key, value can be single
quotes; empty value is None; Boolean is False/True
2. Convert the dictionary to json
Convert dictionary type to JSON object
json.dumps()
Example:
json_obj = json.dumps(dic)
3. Convert json to dictionary
Convert json format to python dictionary type
json.loads()
Example:
dic_obj = json.loads(json_obj)