Skip to content
← Python for AI/ML · all 50 levels

JSON

Level 45 of 50 · Errors, files & modules

Level 45 of 50

JSON

how apps send data to each other. Watch the reel, then work through it below: run the code, take the quiz, keep the cheat sheet.

📒 Open the cheat sheet
SanaHow does the cricket app get live scores from the internet?
TeacherAs text, in a format called JSON! Python speaks it too!
score.py
import json
p = {"name": "Hamza", "runs": 72}
s = json.dumps(p)
print(s)
Teacherjson.dumps turns a dict into JSON text!
SanaIt looks EXACTLY the same! What changed?
TeacherNow it is ONE string! Ready to save, or send to any app.
weather.py
import json
s = '{"city": "Karachi"}'
d = json.loads(s)
print(d["city"])
Teacherjson.loads goes back. Text in, dict out!

⏸ Pause & predict: what prints?

import json
s = json.dumps({"rs": 500})
print(s[0])

Where this leads

Python is step one. Building AI that ships is the rest.

The diploma takes you from zero to deployed computer vision, LLM and agent projects, with engineers who build them for a living. Already code? The bootcamp does it in three months.