1import json
2# Data to be written
3dictionary ={
4 "A": 5,
5 "B": "guys",
6}
7
8# Serializing json
9json_object = json.dumps(dictionary, indent = 4)
10print(json_object)
11# Output
12{
13 "A": 5,
14 "B": "guys",
15}
1# app.py
2
3import json
4
5appDict = {
6 'name': 'messenger',
7 'playstore': True,
8 'company': 'Facebook',
9 'price': 100
10}
11app_json = json.dumps(appDict)
12print(app_json)