AtlasLog in
Black FridayHalf off Premium, through Sunday, Nov 29.See plans

Python, run line by line.

Intro to Programming in Python

7 chapters
No. 018 pages

Values, names and types

Five lines of Python beside a frame of names: score and best each send an arrow to an int object, score now to 43 and best still to 42, while name and other both point at the one string object 'Ada'
No. 028 pages

Decisions and loops

Scores falling down a ladder of paper diamonds, score >= 90, score >= 80 and score >= 70, to the first true condition, which turns red and sends the score right into its grade, beside the if / elif / else code
No. 038 pages

Functions

The recursive fact function beside its call stack: under the global frame, three paper boards for fact(3), fact(2) and fact(1), each holding its own n, the deepest returning 1
No. 048 pages

Lists, tuples and strings

A list of six paper tiles, nums, with its indices beneath and blue fence posts between items marking a slice; the items the slice takes rise in red
No. 058 pages

Dictionaries, sets and files

A hash table of eight paper slots numbered 0 to 7, with keys 12, 20, 5 and 9 in their slots and a red key stepping past a taken slot to the next free one
No. 068 pages

Classes and exceptions

A class Dog drawn as a board holding its shared attribute kind, beside two dog objects, each a board of its own attributes, with names in the global frame pointing at them
No. 078 pages

Searching, sorting and efficiency

A list drawn as eight paper bars of different heights, part way through merge sort, the part just merged in blue beside the merge_sort code