Python·100 questionsHow to read/write JSON?SaveUpdated: 2026-08-31Answer•import json.•json.loads(text) → dict/list.•json.dumps(obj, ensure_ascii=False) → string.•For files: json.load(fp), json.dump(obj, fp).•For datetime, convert (e.g., ISO string).Ask AI to clarifyWas this answer helpful?HelpfulNot helpfulSuggest an improvement