Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
PYTHON FILES / CHAPTER 05 / Learn / LESSON 01
Chapter 5 — Files and data. Before reading from disk, we introduce the standard csv and json modules.
import csv import json
A module is library code. import makes it available. json.dumps turns a Python dict into text; json.loads reverses it.
Example: payload = {"item": "pen", "qty": 2} print(json.dumps(payload))
No files yet — just show the modules work. Later csv reads tables and json reads configs.
Learn: csv/json modules before files.
MODULES IDLE
›