
Category · Python
A language where a block is indentation, not braces
Syntax, lists and dicts, functions, classes, errors, files, venv, JSON. Eight lessons, and you can write a script without being afraid of the interpreter.
To the first lessonCheatsheet nowTopics, each as its own lesson
01Indentation, names, types as a habitDemoThere are no block braces. A block is defined by indentation. You don't write the type up front, but the value still has one.
10 min
02Lists, dicts, loopsA list is a sequence. A dict is key → value. for goes over the elements, not by index, unless you need the index.
11 min
03Functions, return, modulesdef isn't a type. return gives back a value. No return — you get None. An import is like a file next to yours.
11 min
04Classes, self, methodsA class describes a shape. self is this instance. Don't confuse a class with an object.
11 min
05try / exceptAn error is an object. Catch a specific type, not a bare except.
10 min
06Files and withwith opens and closes by itself. Reading text — specify the encoding.
10 min
07venv and pipDependencies live in a virtual environment, not in the system Python "for the whole computer".
11 min
08JSON and a simple requestjson.loads reads a string. A network response is bytes/text, then parsing. Check the keys.
12 min0/8 topics open. This is the course intro, not the whole course on one page.