[Edu-sig] My experience teaching Python

Stephen R. Figgins fig@oreilly.com
Tue, 22 Feb 2000 12:30:42 -0800


>On Tue, 22 Feb 2000, Martijn Faassen wrote:
>
>> 'for' loops presented more problems, though! I had quite a bit of difficulty
>> to explain that the for block gets executed for each element in the sequence
>> and that the variable (for variable in foolist) refers to something else
>> each time in the execution. I need to think on a better way to express
>> things apparently-tricky thing.
>
>I had the same troubles.  Anybody got any brainstorms on this one?

Maybe the for loop problem you are having is because you didn't 
relate it to something the student can visualize. How about tying it to a
real world example?  While you might choose something else... let's
say you have three dolls [Meg, Sandy, Pug] and you want to tie ribbons
in each doll's hair... *for* each doll you will tie a ribbon.  You
line up the dolls and grabbing the first [Meg] you tie a ribbon in her
hair.  Done with Meg you grab the next doll and do the same thing.
When you have done this with all of the dolls, you move on to the next
thing you want to do.

Once they have that concept, you can tell them about using numbers and
testing for end conditions.

Stephen