PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Python · Theory

JSON in Python

← All stacks

Theory

72/268

JSON in Python

JSON is text data. Python’s json module converts. json.loads: JSON string → dict/list. json.dumps: Python object → JSON string. json.load / json.dump work with files. JSON object ↔ dict. JSON array ↔ list. The extra s in loads/dumps means string.

APIs send JSON. You dumps a dict of marks, send it, loads it back. Don’t confuse dump (file) with dumps (string). That letter is the MCQ.

JSON in Python — output — Asha then {"name": "Asha", "marks": 90}. loads parse, dumps text.

Exam tip

s in loads/dumps means string.

Example

# JSON
import json
s = '{"name": "Asha", "marks": 90}'
d = json.loads(s)
print(d["name"])
print(json.dumps(d))

JSON in Python — output: Asha then {"name": "Asha", "marks": 90}. loads parse, dumps text.

Short notes

  • DefLoads / dumps = string
  • RuleLoad / dump = file
  • RememberDict ↔ object, list ↔ array

Questions

1

Explain JSON as if you are teaching a junior — definition, then one tiny script.

2

What does the example print, and why?

3

What mistake do freshers make with JSON?

Previous← Write Excel File in PythonNextContext Manager in Python →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.