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