<br>
Today was my 4th session in a sequence of nine. <br>
<br>
I think the way it's developing for me is I hand out worksheets, which
pose questions around Python, and students have the option to just fill
them in, knowing Python &quot;in their heads&quot; well enough to not consult the
actual interpreter.&nbsp; Others run the questions through
Python.&nbsp; Others do a little of both.&nbsp; Worked pretty well
today.&nbsp; The kids seemed very engaged.&nbsp; I walked around
helping and explaining.&nbsp; We were in learning mode, not &quot;prove to
me you already know it&quot; mode.<br>
<br>
We started out with an xmlrpclib demo.&nbsp; My setup was lame:&nbsp;
Ethernet from my laptop to a neighboring PC, with an air gap to the
actual PPS intranet.&nbsp; So of course it didn't work.&nbsp; Even
after fixing the link, I was having problems.&nbsp; But some of the
kids got their examples to work.&nbsp; In a way that was good:&nbsp;
teacher in a group with floundering students, other students having it
work.&nbsp; Very democratic.<br>
<br>
At the very end of the class, I retold the story about the young Gauss,
this time suggesting he did the whole thing in his head.&nbsp; Like,
the teacher said add 1 to 100 and he said hmmmm, that's range(1,101)
and range(100, 0, -1) on top of each other, and a sum of 101, 101,
101... 100 times = 100(101).&nbsp; But that's twice the sum you need,
so voila, 5050, in like 8 seconds.&nbsp; Stunned teacher.<br>
<br>
I explained why such consecutive sums-from-1 are considered
&quot;triangular&quot; and threw out this challenge:&nbsp; class is about to end,
but if anyone thinks they can do this:<br>
<br>
def tri(n):<br>
&nbsp;&nbsp; # something goes here<br>
&nbsp;&nbsp; return answer<br>
<br>
then let me know now.&nbsp; Type type type.&nbsp; A hand goes up.&nbsp;
I quickly memorize the student's solution and transfer it to the screen
up front (laptop -&gt; projector -&gt; screen):<br>
<br>
def tri(n):<br>
&nbsp;&nbsp; num = n * (n + 1)<br>
&nbsp;&nbsp; num = num / 2<br>
&nbsp;&nbsp; return num<br>
<br>
(actually the student said 'print num' and I said that'd be OK too).<br>
<br>
And yes, tri(100) returns 5050, so big win.&nbsp; The kids felt one of
their own had risen to the challenge, not in a competitive way, but as
their representative.&nbsp; A peer had passed a tough test on their
behalf. &nbsp;<br>
<br>
Note:&nbsp; using &quot;__past__ style&quot; division is OK in this context, as
n, n+1 must form an even/odd pair, meaning their product is even,
meaning 2 divides with no remainder (i.e. integer division OK).<br>
<br>
Kirby<br>
<br>