[Edu-sig] Exhibit: Session 2 of 10, a Python training

kirby urner kirby.urner at gmail.com
Sat Jun 24 12:04:52 EDT 2017


On Fri, Jun 23, 2017 at 6:32 PM, Carl Karsten <carl at nextdayvideo.com> wrote:

>
> On Fri, Jun 23, 2017 at 3:12 AM, kirby urner <kirby.urner at gmail.com>
> wrote:
>
>> Looping with for
>>    more string formatting
>>
>
>
> Kerby, I am curious about the pedagogy of introducing two distinct
> concepts at the same time like that.   Care to elaborate?
>


I introduce string formatting with {placeholders} early in the training,
and then keep using that. I also use the keywords list (keyword.kwlist) for
raw material, when introducing for loops. So something like this:

from keyword import kwlist

for word in kwlist:
    if word.islower():  # showing how conditionals work
        print("Lowercase keyword: | {:20} |".format(word))

The format method is a good stand-in for callables in general in that we
can start looking at positional versus named arguments, * and ** as
argument exploders etc.

So yeah, my technique is to keep introducing new concepts (e.g. for loop)
while continuing to use those looked at so far (e.g. print formatting).

Kind of like a juggling act, where one keeps introducing more balls.

Kirby


Kirby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20170624/7bc824de/attachment.html>


More information about the Edu-sig mailing list