1import json
2
3# with json.loads (string)
4info = '{"name": "Dave","City": "NY"}'
5res = json.loads(info)
6print(res)
7print("Datatype of the serialized JSON data : " + str(type(res)))
8#>>> {'name': 'Dave', 'City': 'NY'}
9#>>> Datatype of the serialized JSON data : <class 'dict'>
10
11# with json load (file)
12info = open('data.json',)
13res = json.load(info)
14print(res)
15print("Datatype after deserialization : " + str(type(res)))
16#>>> {'name': 'Dave', 'City': 'NY'}
17#>>> Datatype of the serialized JSON data : <class 'dict'>