Using json for Data Serialization in Python


Serialize and deserialize data to and from JSON format.

Source Code

import json
data = {"name": "John", "age": 30, "city": "New York"}
json_data = json.dumps(data)
print(json_data)
data_back = json.loads(json_data)
print(data_back)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments