PyCon 2013: Young Coders

19 March 2013

This year at PyCon, I had the honor of co-teaching the very first workshop just for children at PyCon. Barbara Shaurette and I taught approximately 35 kids from eight to eighteen the basics of programming Python.

The class was offered for free to all children, and all kids got to take home a Raspberry Pi at the end of the day. The students came from attendees and the local community. Some parents were Python developers, and some had no idea what programming was. They just knew this was a chance to enrich their children's lives.

What did we teach?

Barbara took her materials that she uses for her class and, with minimal tweaks, converted them to a kids' class (I'm lazy, and have no slides for my classes). We tweaked the lesson plan for the second day when we realized that some things were confusing to the kids (or to the teacher who couldn't remember how slices work).

This is roughly what we taught:

  • Who are we, and what do we do with Python?
  • What is programming?
  • What's an algorithm (the peanut butter and jelly example)
  • Numbers + math
  • Strings
  • Lists
  • if statements
  • Loops (for and while)
  • Input + Output
  • Functions
  • Objects
  • Imports
  • Let's make some games!
  • Number guessing
  • Raspberry Rogue
  • State capitals
  • Care and feeding of your Raspberry Pis

With the first class, we had to take lots of breaks. Every other module, we'd let the kids get up and move around or run to the bathroom. The second class, where the kids were older, we didn't need as many breaks (in fact, they often refused breaks), so we got through way more material. In fact, we ran out, so I ended up live coding a few more examples and running through some code Barbara had written for another class.

Barbara and I swapped back and forth as needed. Sometimes, one teacher needed a break. Other times, the other teacher knew more about that module so wanted to take point.

Volunteers

I'll confess, I was worried when I saw how many volunteers were signed up to help us. Would it be too confusing? Would we have too many chefs in the kitchen? I didn't want to tell anyone that they couldn't come, though, just in case some people couldn't make it (or forgot that they had signed up).

I asked the volunteers to stand or sit at the back of the room and watch the kids' monitors rather than the slides. My reasoning? If they're focusing on what Barbara or I were saying, they were missing what was going on with the students. The one thing we couldn't see was the kids' monitors, so we had no idea if they were lost, if their Pi was throwing errors, or if they were done typing an example. I also needed them to grab the 'off' teacher to tell us if we needed to go over something again, or if they'd noticed something particularly interesting that a student had done.

One thing I made sure to ask was that they not interrupt the class, even if they noticed an error. Having two teachers, though, meant that there was always someone they could grab and talk to quietly.

We ended up having around a 1:3 ratio, and it was perfect. Volunteers were able to jump in if a student was floundering, and many developed a relationship with a few select kids over the course of eight hours. The volunteers were also an invaluable asset to me, letting me know with nods and hand signals if I could move on, or if I needed to chill out for a bit.

Tools

We used IDLE because it's already on Raspian's desktop. Personally, I like IDLE as a teaching tool. It's included in the standard library, it does tab completion and color coding, and it even has a text editor included so you don't have to start your class off by teaching everyone about paths.

Too bad it's broke as hell.

I believe my first contribution to the Python Standard Library will be fixes to IDLE. I really do like it that much. Happily, the kids were flexible. If they needed to do a workaround, or ignore something on our slides (they were written with the standard shell in mind), they did so. They were total champs. My adult students would have been much more upset.

So... what was it like?

It was amazing. It was exhausting. I wanted to do it again. I wanted a drink.

The kids were fabulous (I only had to use Mom Voice once). They stayed on task in a way I've never seen. Hell, at work, if we've been coding for a whole hour we start whining that we need a Starbucks run. They had a network connection and never once did I see Facebook open. They had a link to Python games as well, and only opened them during breaks.

People kept stopping by and peeking in, then giving us little cheers at the sight of rows of kids with their 'coder faces' on. I tried to impress on the kids that they were the stars of PyCon. I'm not quite sure they bought it, but it's true. Everyone was so excited about the classes. I got stopped at least once an hour by someone who wanted to know about it, or how they could do it themselves.

We even had a group of programmers from Mexico approach Jesse and offer to translate our slides so that they could teach the classes in their home country. I believe we're even finding a way to send them Pis so they can copy our set-up exactly.

Lessons learned

How are my son's teachers not alcoholics?

The biggest lesson learned? Two days of teaching, even shared between two teachers, is probably too much. Barbara and I were about to collapse by the end of it. When you teach an eight-hour class, you have to be 'on' for the entire time. Even when we weren't actively teaching, we were looking at the next module, walking the room, talking to a volunteer, or helping a student. Even our break times were spent going over what we needed to change in the slides.

Next time? Two different teachers every day. The optimal pair would be two people who know each other well and can pass the ball back and forth with a minimum amount of effort. Barbara and I have known each other for years, so this was was easy for us. It would have been harder if it was someone I didn't know as well.

Mavis Beacon they aren't

With the exception of a few of the teenagers, the kids were not fast typists. When I was live-coding, some tried to follow along, word for word. As I raced ahead, they became discouraged. We also had long variable names in the examples, which took forever for the kids to type in (and they wanted to type in every code sample).

Oh man, objects...

We were able to get to classes, but it turned out to be something that's a bit difficult to explain. I'm still coming up with a story that will make objects easy for kids to grasp. I don't want to ignore them because many of the kids want to make a game, and that requires understanding what an object is.

Wait, they need to eat?!

We forgot to feed the kids snacks at snack-time. Barbara and I both face-palmed, especially since snacks were provided for tutorial attendees.

The future

I want this class to happen again. I want to see it done at PyCons, big and small. I'd love to see them done in smaller communities, and I even have a few leads back home. People offering to translate our slides has me jumping with joy.

I have ideas for adding to the class, and I'd love to see what other people might add to the material.

I will totally be doing this again and again.

Share

Related tags: kids python

Comments

1 matt harrison says...

Great write up. I've taught elementary kids Python before (3rd-6th grade) and it is not easy. Material for my course is up on Github [0]. I would have loved to help out if I wasn't teaching tutorials myself.

0 - https://github.com/mattharrison/ElementaryPython

Posted at 11:21 a.m. on March 19, 2013

2 Brian Reynolds says...

Thanks for the write up.I am learning to teach Python to 6th graders. I have an hour a week with the kids and have experienced many of the same things. I would love to see your slides.

Posted at 12:27 p.m. on March 19, 2013

3 William says...

Such an inspiration! This is something that needs to be available to children in every school. I can remember going to school and having no idea why or how the computers were doing the wonderful things, but I wanted to make one. Today you and Barbara are my heros! :)

Posted at 2 p.m. on March 19, 2013

4 Kent Johnson says...

IMO classes are hard to teach because they are not useful until you reach a certain level of complexity, and it is not clear to beginners what problem they are solving. My attempt to bridge this gap is here: http://kentsjohnson.com/stories/00014.html It doesn't try to be comprehensive, but rather to give some simple hints as to when and why classes might be helpful.

Posted at 2:17 p.m. on March 19, 2013

5 Greg Wilson says...

We've given up on trying to teach classes and objects to adults who are novice programmers in a two-day workshop: there are just too many "huh??" moments (double-underscore init? I have to declare with self, but I don't pass it in?), and there's so much they can do without that. We use lots of objects and their methods, though. And yeah, IDLE is broken. The IPython Notebook is pretty cool, though; Software Carpentry is shifting its teaching to that.

Posted at 3:55 p.m. on March 19, 2013

6 Kirk Strauser says...

My kids attended the workshop and raved about it for days. Thanks so much to both of you, and to everyone who helped make it happen!

PS: I told the kids about Eben Upton's keynote where he described using Python to script Minecraft. They're bouncing off the walls and begging me to please hurry and set this up for them so that they can start programmatically building things.

Posted at 4:20 p.m. on March 19, 2013

7 Chris says...

OOP is hard, even for quite some adults. My standard example goes along these lines: http://pastebin.com/kULumt4Z

Usually I build it bit by bit with the audience looking and interrupting when necessary and it can be extended to cover a lot of aspects.

Posted at 4:28 p.m. on March 19, 2013

8 Shawn Wheatley says...

Great job and congratulations to you and Barbara. I really, really wanted to volunteer for this but wasn't even able to attend PyCon this year (2 years in a row after attending every year prior!).

Before you fix anything in IDLE, check out IdleX: http://idlex.sourceforge.net/ They may have done the heavy lifting for you already. Why these changes haven't made it back into CPython trunk is beyond me. Also I agree with Greg, IPython Notebook would also be a good tool to get people started with, provided that there's an easy setup script for bootstrapping everything.

Finally, if you teach a kids class in the Baltimore/DC area, please let me know. I'd be happy to volunteer to help!

Posted at 9:21 p.m. on March 19, 2013

9 Jeff Self says...

What an awesome thing to do at PyCon! Wish I could have been there. Being the coordinator for our local Python group, I've thought about moving it in this direction. I would love to have some classes for kids. I bought my kids the 'Python for Kids' book in February. We haven't had an opportunity to look through it yet. Hopefully, they will have some down time this summer. Even thinking about taking a few days off to have all our friends' kids over for a Python lesson.

Posted at 10:36 a.m. on March 20, 2013

10 Nick Coghlan says...

Managing IDLE development has long been a challenge for the core developers - it's an application that has long been developed under standard library rules, and that's just not appropriate.

PEP 434 (http://www.python.org/dev/peps/pep-0434/) is aimed at making it clear that changes that would not be accepted elsewhere under the "no new features in maintenance releases" rule are acceptable in IDLE.

We're also in the process of granting Roger Serwy (maintainer of Idle X) commit privileges, so many of the Idle X fixes will hopefully be making their way back into the core over coming months. (This will also hopefully help with getting IDLE patches reviewed more promptly)

The IPython notebook dependency stack is huge, so while it's a powerful and compelling tool, it's not appropriate for teaching in all circumstances.

Posted at 1:32 p.m. on March 20, 2013

11 Terry Jan Reedy says...

Too bad people exaggerate like hell -- especially in blog posts ;-).

I use IDLE almost daily and it works for me, especially with some of the more recent fixes. I have worked on IDLE issues on and off for over a year. But I have no idea what you think is 'broken as hell'.

Given your experience teaching with IDLE, I would be very interested in knowing what you think are the top 3 or so outstanding issues. As well as here, you could also post to the idle-dev list, http://mail.python.org/mailman/listinfo/idle-dev, which is mirrored as gmane.org newsgroup gmane.comp.python.idle.

You did not specify which Python version you used, but since 3.3.0 there have been about 30 patches pushed. I hope to see than many again in not too many months. You are welcome to join us to help make that happen.

Posted at 9:03 a.m. on March 21, 2013

12 Katie Cunningham says...

@Terry:

We were using 2.7, because most of the libraries the kids were interested are in Python 2+, not 3. Also, the books we gave them were all in 2+.

I was planning on joining the IDLE group. Are they all jerks like you, though?

Posted at 9:28 a.m. on March 21, 2013

13 Kartik says...

Awesome! Waiting for my son to grow up and teach him Python ;)

Posted at 2:01 a.m. on March 22, 2013

14 Alvin says...

Thanks for holding it. My son really enjoyed it. Technically, he is 7 but I fudged his age a little because I was afraid he might not get in. :)

I told some of my son's friend's parents about it. Now, we have been motivated to start club for python raspberry programming and robotics.

Posted at 2:23 a.m. on March 22, 2013

15 Ryan says...

This was such a brilliant idea. We need more of these types of events. Kids are too stuck in the world of textbooks and homework and they strive to learn real world skills like programming. By learning programming, they will excel in other science related disciplines and perhaps non-science disciplines as well. I would love to get involved in future activities like this.

I am so upset I missed PyCon.

Posted at 2:54 a.m. on March 22, 2013

Comments are closed.

Comments have been closed for this post.