Cast in Practice

Picture left, code right, one idea per row. The drawing carries the concept; the code carries the syntax.

A lever and a door

The lever is the boolean. The door only opens when it is up.

1is_open = False
2
3if is_open:
4print("come in")

A basket of fish

Three items, one container. Colour tells them apart without a single label.

1bucket = ["nemi", "koi", "bo"]
2
3print(len(bucket))

A bird down a street

One visitor, many houses. That is a loop before the word is spoken.

1for house in street:
2deliver(house)

Rule of the cast: a sprite keeps one meaning for the whole course. Colour separates instances, never concepts — a mint fish and a coral fish are two fish, not two ideas. Pair every scene with the code beside it, so the picture is a caption for the syntax and never a replacement for it.

60.2/60