[Edu-sig] My experience teaching Python

Martijn Faassen faassen@vet.uu.nl
Wed, 23 Feb 2000 12:18:22 +0100


Kirby Urner wrote:

> >I've taken a look at Learning Python and it doesn't seem to have the right
> >structure if you're completely new to programming. My friend bought it 
> >and hasn't been too much use to her so far, though I expect it probably
> >will be later on.
> 
> I like your approach Michael.

That's Martijn -- Michael is the guy whose thread I hijacked; my 
apologies to Michael!

> Play in the interactive mode, show how
> this can be used to test your understanding of the various operators
> (sometimes I call them "toys" -- not in a deprecatory sense at all),
> then go right into combining statements into function defs (programs).
> 
> This is a great segue from Logo (which many kids learn), which likewise
> has the interactive command line, plus the short, atomic procedures.
> 
> A few comments:  
> 
> *  Those who can use IDLE will probably find it a lot easier than Emacs.  
>    The newest IDLE even prompts for correct syntax, plus the stepwise 
>    debugger (still rudimentary) gives beginners a fun way to watch simple 
>    programs in action.

Probably true -- I myself am pretty unfamiliar with IDLE so far, though
(was just toying with it again yesterday), so I went with Emacs. For basic
editing both are fine, and I wasn't beyond that yet.

> *  You can do a lot in interactive mode.  I like to show students that
>    it's more fun to calculate at the command line than on a TI.  In 
>    part because calculators don't have any savvy about alpha operations,
>    like 3*"CAT" = "CATCATCAT".  Yet modern mathematics is a lot about
>    symbolic manipulation beyond what we do with numbers.

Yes, I showed things like this. You can do some amusing things there, which
will keep the students happy.

> *  Keep in mind that you, as a teacher, can pre-write simple modules 
>    which, when loaded, do interesting things at the command line.  

That's a good idea -- I'll try that approach.

>    Then invite students to look at your code.
[learning by studying other programs]
I did some of this, but it's probably good to put some more emphasis on this.

> If you haven't taken a peak, I invite you to check out my 3 part essay 
> integrating learning Python within in a math class context.
[snip]
>    http://www.inetarena.com/~pdx4d/ocn/numerarcy0.html
>    http://www.inetarena.com/~pdx4d/ocn/numerarcy1.html
>    http://www.inetarena.com/~pdx4d/ocn/numerarcy2.html

These links don't seem to work, unfortunately!

> My approach dovetails with yours, in that I'm focussing on the 
> interactive command line at the start.  What's not explicit in these
> pages is a lot of nuts and bolts about "types" (int, float, string),
> which you get into, nor even data structures (list, tuple, dictionary).
> 
> This isn't because I'd want to skip any of this.  But first I want
> to get students to "buy in" by seeing Python do a lot of relevant
> work.  Then we start dissecting the code, and phasing in the nuts 
> and bolts stuff using a more "and by the way" approach.  Start by
> showing relevance, then get into the guts of programming.

The problem in my case is that there's no 'relevance' as such yet; your
students are in a math class, mine are in a 'what's programming all about'
class and don't have clear goals yet.

[recursion versus procedural]

I hadn't gotten far enough yet to introduce those concepts. :)

Thanks for the feedback!

Regards,

Martijn