fork download
  1. import json
  2.  
  3. obj = dict(name='小明', age=20)
  4. s = json.dumps(obj, ensure_ascii=False)
  5. print(s)
  6.  
  7. # your code goes here
Success #stdin #stdout 0.17s 15564KB
stdin
Standard input is empty
stdout
{"name": "小明", "age": 20}