Build with Python: a beginner course where code draws
A walk through the first module of a beginner Python course: what each drawing line teaches, which mistakes stay silent, and where a picture-first approach stops being enough.

The usual first Python program prints a line of text, and a beginner has little way to tell whether the computer did what they meant. If the text is right, it worked. If it is wrong, they have no picture of what went on in between. Feedback that is easy to read matters most in the first hour, when a learner does not yet trust their own reading of the code.
The first module of Build with Python, called 'Make a Picture', starts from the opposite end. Its instructions draw shapes, so a wrong program produces a wrong picture, and the mistake can be seen. It assumes no experience. The stated goals are to read a line of drawing code and say what it draws and where, to write a short program that draws a described picture, and to use an error message to find the line that is wrong.
What follows is a close look at how that module is built and what each small program is there to teach. It also covers where a picture-first approach stops helping.
A program is a list of instructions, and order is part of the meaning
The module's first program is five lines long:
from scimigo import canvas, rectangle, circle
canvas(600, 400)
rectangle(200, 100, 200, 200, color="orange")
circle(300, 200, 60, color="blue")
Python runs the first line, then the second, and carries on down the page until there are no lines left. canvas(600, 400) makes an empty picture, the rectangle line draws an orange box, and the circle line draws a blue disc.
The disc appears in front of the box because its line comes later, and each shape is painted over whatever is already there. Swap the last two lines and the program still draws both shapes, but you see only one. Nothing has gone wrong. The disc was drawn first and the box covered it. A beginner can try this swap in seconds and watch 'top to bottom' stop being an abstract rule.
Which parts are Python and which are the course's tools
The course is explicit about a distinction that is easy to blur. canvas, rectangle and circle are not part of Python. They come from scimigo, a small set of drawing tools made for the course, which is why every program begins with a from line that brings them in. In this module that line is written for the learner.
Python itself is the order of the lines, the names, the numbers and the text, and later decisions, loops, functions and lists. The course states that everything learned about the language is ordinary Python and works wherever Python runs, while the drawing tools work only on its own pages. That is a fair trade-off to state up front. The picture is a teaching aid, and the skill that transfers is the language underneath it.
One instruction, taken apart
The module then slows down to a single line:
circle(300, 200, 60, color="blue")
circle is the name of the instruction. The parentheses hold the details it needs, separated by commas. Using an instruction is called calling it, and the details are its arguments. The first three have fixed jobs decided by position: the distance of the centre from the left, its distance from the top, and the size of the disc.
The consequence is the first quiet failure in the module. Swap two of those numbers and Python does not notice. It draws a different picture:
from scimigo import canvas, circle
canvas(600, 400)
circle(300, 100, 60, color="blue")
circle(100, 300, 60, color="lightblue")
The second line has the first two numbers the other way round. Python did exactly what it was told both times, so no error message appears. The course's advice is practical: when a shape is in the wrong place, check the order of its arguments first.
Where is (x, y)?
Every position is two numbers. The first, x, is how far to go from the left edge. The second, y, is how far to go down from the top. The point (0, 0) is the top-left corner. The module teaches this by drawing red circles at (100, 100), (500, 100) and (100, 300) and labelling each with text, so the coordinates and the picture sit side by side.
Anyone who has drawn graphs at school has the opposite habit, where a bigger y is higher up. On a screen a bigger y is lower down. The course says that almost every beginner places a shape too high or too low at least once because of this. Naming the cause in advance turns a puzzling mistake into a recognisable one.
One more placement rule: a circle is placed by its centre, while a rectangle is placed by its top-left corner and stretches to the right and downwards. In the opening program, rectangle(200, 100, 200, 200) and circle(300, 200, 60) share a centre point for that reason.
Numbers, and text in quotes
The arguments so far are of two kinds. 300 is a number. "blue" is text, and the quotes are what make it text. Remove them and Python no longer sees a word. It sees a name and expects to have been told what the name means:
circle(300, 200, 60, color=blue)
File "your_program.py", line 4
circle(300, 200, 60, color=blue)
NameError: name 'blue' is not defined
The report names line 4 and quotes it. Python is not objecting to the colour. It is saying nobody has defined blue. In the other direction, "300" in quotes is the characters 3, 0 and 0, not the number three hundred, and a position needs a number.
Arguments with names
color="blue" is an argument with a label on it, and so is the size in this line:
text(150, 210, "Hello, Python", size=48)
A labelled argument says which detail it is, so it does not depend on position, and it can be left out when the usual value will do. The split in the module is simple: positions and sizes are given by position, colour and text size by name. This also contains the silent-swap problem above. Position-based arguments can be confused with each other, but a color= label cannot be mistaken for anything else.
Reading what Python says when it says no
The course normalises error messages early. It says people who have programmed for twenty years see them every day. A message has three useful parts: the line it is about, the kind of problem, and a few words about it. Its example is a misspelt instruction:
circl(300, 200, 40)
File "your_program.py", line 4
NameError: name 'circl' is not defined. Did you mean: 'circle'?
The line number is 4. The kind of problem is the first word of the last line, NameError. To Python, circl and circle are two different names, and it has only been told about one. Here it even suggests the name you probably meant, but it will not make the change for you. That matches the third goal of the module: use the message to find the line that is wrong, then fix it yourself.
Where this approach does not fit
Drawing makes some mistakes visible, but not all of them. The swapped arguments example is the clearest case: Python raises no error, and the only evidence is a picture that looks wrong. A learner has to look at the output and compare it with what they intended, which is a skill the module is deliberately building but not one that comes automatically.
The other limit is portability. The drawing tools are made for the course and work on its pages, so a learner who finishes the module has learned real Python but has not learned a drawing library they can take elsewhere. The course is upfront about this, and a reader choosing between courses should weigh it. Whether the later material on decisions, loops, functions and lists keeps the same picture-first feedback is something to check on the course itself.
- #NameError
- #Python
- #learn python
- #python course
- #python errors
- #python for beginners



Comments