Answers for "How do I JSON Stringify in Python?"

2

python json stringify

import json

json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
'["foo", {"bar": ["baz", null, 1.0, 2]}]'

print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True))
{"a": 0, "b": 0, "c": 0}
Posted by: Guest on May-20-2020
-1

json.stringify equivalent in python

json_mylist = json.dumps(mylist, separators=(',', ':'))
Posted by: Guest on September-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language