How to convert JSON into String?
import json # list with dict a simple Json format json_exp = \ [{"id": "12", "name": "Mark"}, {"id": "13", "name": "Rock", "date": None}] print(type(json_exp)) str_conv = json.dumps(json_exp) # string print(type(str_conv)) print(str_conv)
Sample output of above program.
class 'list'
class 'str'
[{"id": "12", "name": "Mark"}, {"id": "13", "name": "Rock", "date": null}]
2019-07-11T15:43:43+05:30
2019-07-11T15:43:43+05:30
Amit Arora
Amit Arora
Python Programming Tutorial
Python
Practical Solution