Re: Exhibit: Session 2 of 10, a Python training

kirby urner <[email protected]>
Newsgroups gmane.comp.python.education
Message-ID <CAPJgG3RvpYwfeP3sM=mdefyg0+zyjdxqaO+Hgun5mqrtujpCLg@mail.gmail.com>
On Fri, Jun 23, 2017 at 6:32 PM, Carl Karsten <[email protected]> wrote:

>
> On Fri, Jun 23, 2017 at 3:12 AM, kirby urner <[email protected]>
> 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

_______________________________________________
Edu-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/edu-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.