More from Portland

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

More from Portland

kirby urner-4
I've found younger kids especially (13ish) like the Madlib motif, i.e. fill-in-the-blanks stories. 

In today's lesson @ Winterhaven, I had kids enter the code below, helped with debugging (I had about 30, each with a Win2000 box), then suggested they come up with more imaginative stories of their own (by changing the code). 

One student was quite creative with the dictionary keys, putting in things like 'Noun ending in er' (the keys double as prompts in raw_input).

On another front, Winterhaven is happy enough with how this beta is going, and gave me a Moodle account to develop local teaching materials.  This will assist in the process of spreading Python to other public schools in the area. 

Plus sometimes we have kids author content, e.g. some of the Moodle-based HTML teaching is actually done by students.

The worksheet that went with the code below also got into the 'if __name__ == '__main__': option, for when you want to run at the command line, or in IDLE simply by pressing F5.  Until today, we've always imported everything in the IDLE shell.

Per my blog entry of earlier today, Oregon is launching some new education initiatives.  My Oregon Curriculum Network is well positioned to make some of our dreams come true (plus I'm pretty good at frustrating some of the nightmares others-who-shall-remain-nameless  might find it convenient to capitalize on).

Kirby


"""
Worksheet:  substituting strings
"""

story = """
Once upon a time, deep in an ancient jungle,
there lived a %(animal)s.  This %(animal)s
liked to eat %(food)s, but the jungle had
very little %(food)s to offer.  One day, an
explorer found the %(animal)s and discovered
it liked %(food)s.  The explorer took the
%(animal)s back to %(city)s, where it could
eat as much %(food)s as it wanted.  However,
the %(animal)s became homesick, so the
explorer brought it back to the jungle,
leaving a large supply of %(food)s.

The End
"""

thewords = ['animal', 'food', 'city']
userpicks = {}

def tellstory():
    """
    loop through thewords and get user choices in a dictionary
    named userpicks, then substitute userpicks into the story
    """
    for word in thewords:
        userpicks[word] = raw_input("Enter a value for %s: " % word)
    print story % userpicks



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig