Experiences/guidance on teaching Python as a first programming language

Chris Angelico rosuav at gmail.com
Wed Dec 11 17:14:12 CET 2013

On Thu, Dec 12, 2013 at 3:01 AM, bob gailer <bgailer at gmail.com> wrote:
> One student (PhD in Physics) looked at X = X + 1 and said "no it doesn't".

Yeah, which is why some languages (I first met it with Pascal) spell
that as "X *becomes* X + 1"... but regardless of what you call it,
there's a fundamental difference between algebra (where every line is
a statement of truth) and imperative programming (which may change
state as time progresses). What's called a "variable" in programming
really can vary; in maths, it's really just an "unknown". This is a
difference that, one way or another, just has to be taught.

> Another wrote his first program. I took one look at it and saw the mistakes.
> I explained how to walk thru the program step by step. He exclaimed "In that
> much detail?".

You mean a dry run [1]? Yes, can be tedious. Can also be very VERY
valuable, especially if done verbally to another programmer, as a
means of spotting differences between what the programmer thinks
something does and what the language thinks it does.

x = a * b + c

"Set x to a times the sum of b and c."


[1] http://foldoc.org/dry+run

More information about the Python-list mailing list