How to Teach Python to an 11-Year-Old: Real Lessons From Trying It At Home
The kitchen table still had crumbs from after-school goldfish crackers when Javi, my 11-year-old, slammed his Chromebook shut last March. “This is stupid,” he mumbled, kicking the leg of the chair with his scuffed soccer sneaker. “I’m never doing this again.”
I’d bought the heavily discounted kids’ Python course over winter break, after he’d spent three months ranting about how he wanted to make his own Minecraft mods instead of just downloading other people’s. I know just enough basic Python from an old office admin job to automate spreadsheets, so I figured we’d work through 15 minutes a couple nights a week, no pressure. Three weeks in, we were both ready to cancel the subscription.
The lessons opened with definitions of variables, strings, and integers, then had him type lines like print(2 + 2) or calculate the area of a rectangular room. The animated robot host popped up after every correct answer to do a little dance, which Javi said made him feel like he was back in second grade doing math puzzles. He could parrot back that a variable “stores a value” if I quizzed him, but he had no idea why he’d ever need to use one outside the exercise box.
I almost defaulted to the standard parent line, the one I grew up hearing: you have to learn the basics first, the fun stuff comes later. But I bit my tongue. I remembered quitting guitar lessons when I was 10, after two months of nothing but scale drills, before I ever got to play a single chord progression from a song I liked. I pulled the Chromebook back toward me and closed the course tab. “Forget that,” I said. “What’s one dumb little thing you wish a computer would do for you right now?”
He didn’t even have to think about it. His best friend Mia had beaten him at rock-paper-scissors over text three nights in a row, and he was convinced she was cheating. He wanted a program that would pick a move for him so she couldn’t read his pattern.
We skipped the fancy software installation entirely and pulled up a free browser-based coding tool, so we didn’t waste 45 minutes troubleshooting downloads before we got to the fun part. That night, we didn’t talk about variables as a concept. We just started typing. I had him type the three options into a list first – rock, paper, scissors – and told him the computer could pick one at random if we borrowed a little pre-written tool called random. That took five minutes, and the first time it spat out “scissors” unprompted, he blinked and leaned in. Then we had to add the part where he types his move, and the program says who wins. That’s where we hit the first wall: indentation.
He got an invalid syntax error three times in a row, and he couldn’t see what was wrong. He’d typed all the code correctly, but he’d added an extra space after the colon on the if line, then indented the next line too far. I didn’t pull up a slide deck about Python’s indentation rules. I pointed to the book report he’d turned in that week, sitting on the counter under his backpack. “You know how you indent the first line of every paragraph in English class?” I said. “That tells the teacher this line belongs to this paragraph. This is the same thing. All the stuff that happens if you pick rock has to line up the same amount, so the computer knows it goes with that line.”
He fixed it in 10 seconds. Twenty minutes later, the whole thing worked. The first edit he made on his own, before he even sent it to Mia, was adding a line that printed “you suck” when the computer won. I didn’t make him delete it. I just told him not to complain if she sent a version back that roasted his soccer skills.
I mentioned this to his school’s tech teacher at conferences a month later, and she nodded like she hears this every week. 11 is a weird sweet spot for text-based coding like Python, she said. Most kids that age have the typing speed and working memory to handle syntax rules, and they’re sick of block coding like Scratch, which most of them have done on and off since second or third grade and see as baby stuff. But nearly every pre-written course is built backwards for how kids this age actually learn. It teaches every concept in order, just in case they need it later, instead of teaching the concept the second they actually need it to build something they care about.
That shift changed everything for us. We never went back to the course’s linear order. A week after rock-paper-scissors, he needed a program to roll a 20-sided die for his after-school D&D club, since he kept leaving his physical set in his locker. He got tired of copying and pasting the random roll line every time he wanted a new turn, so that’s when we looked up how for loops work. He didn’t learn loops as a “core programming concept” to memorize for a quiz. He learned them as a trick to save himself 10 seconds of boring typing.
A lot of parents I’ve talked to about this assume you have to be a professional coder to teach Python to an 11-year-old, and that held me back at first too. Half the time, I don’t know what an error message means off the top of my head. Last month, we spent 15 minutes stuck on an index error when he tried to pull the winning move out of our list, and I had no clue what was wrong. We pulled up the first beginner-friendly Stack Overflow result, read through it together, and he figured it out before I did: he’d asked for the fourth item in a list that only had three. I didn’t pretend to know the answer, and he learned that looking up what you don’t know isn’t cheating – it’s just how everyone does this, even people who code for their job.
We also stopped treating it like homework. I used to block 30 minutes every Tuesday and Thursday, write “coding” on the calendar, and remind him 10 minutes before it was time. That made it feel like a chore, same as math worksheets. Now, we mess around with it after dinner a couple nights a week, only if he brings it up. Some weeks, he doesn’t touch it at all, if soccer practice runs late or he’s obsessed with a new Zelda dungeon. I don’t nag him about it.
It hasn’t all gone smoothly. A few weeks ago, he decided he was ready to build that Minecraft mod he originally wanted, using a popular Python modding tool. The installation instructions were written for adults, and we messed up the file path three times in a row. He got so frustrated he closed the computer and didn’t touch it for four days. I didn’t make him go back to it. On Sunday morning, after he finished his pancakes, he pulled the Chromebook out on his own, rewatched the first two minutes of the tutorial, and fixed it. The mod he built makes 12 chickens spawn every time he punches a tree. It crashes if he does it more than three times in a row, and it serves absolutely no practical purpose. He showed it to every kid on his soccer team at practice that week.
He still can’t define most of the terms the original course had on its first unit quiz. He still messes up indentation at least once every time we sit down. I still have no idea if he’ll stick with this long term, or if he’ll drop it next month when he gets into skateboarding like his cousin. That’s fine by me. I went into this thinking the goal was to get him “good at Python,” to check a STEM skill off the list. Right now, the only thing that matters is that he knows code isn’t a set of arbitrary rules you memorize for a class. It’s just a thing you can mess with, to make dumb jokes for your friends or solve a tiny problem that only you care about. Some nights, that’s enough.
Please indicate: Thinking In Educating » How to Teach Python to an 11-Year-Old: Real Lessons From Trying It At Home