python
Published on January 26, 2024By DeveloperBreeze
import json
# Dictionary representing data
data = {'name': 'John', 'age': 30, 'city': 'New York'}
# Serialize (convert to JSON)
json_string = json.dumps(data)
# To parse JSON data (deserialize)
parsed_data = json.loads(json_string)
Comments
Please log in to leave a comment.