TransWikia.com

How do I approach teaching Python to 12-year-olds as a first-time teacher?

Computer Science Educators Asked by kosciCZ on June 26, 2021

I’m currently teaching Python, to three 12-year-olds. They have no experience at all, and my task is to introduce them to programming concepts, and to Python. I’m fairly experienced in programming, and I’ll be starting my third year of computer science at university next year.

What I’m trying to ask here is, how do I get my mindset to their level? They struggle with understanding what a variable is, have trouble understanding flow of the program. What can I demonstrate to make them understand better?

I’ve already tried introducing variables, print function, and some flow controlling through conditionals (all came together in a little calculator), but I seem to fail at making it easy for them to understand.

10 Answers

Check out the Python books written by Al Sweigart. His homepage Invent with Python includes some great, free resources that are geared to the age range of your students. In particular he focuses on creating games which is, in my experience, an effective hook. Two books to use to inform your teaching are the following (in order):

You can read the books for free online and download each one's respective source code.

I've spent time teaching the age range in question, and most students just starting out aren't really fascinated by the finer details of variables, loops, and conditionals. They want to see something happen, to make the computer do something fun. Games are the perfect vehicle for this to take place.

Part of what makes Al's approach inviting is that there is a lot of supplied code that students can then customize. They might not get why variables matter at first, but if it becomes a discussion about tracking the level of a game or the current high score (or a list of all-time high scores), then the students' interest will be piqued.

Correct answer by Peter on June 26, 2021

Full disclosure: I'm one of the founders of CodeHS.

We have a python course on CodeHS that you can try. The curriculum is free to use, and you can sign up as a teacher account to be able to see your students' code and test out their programs.

You can see more about the course here: https://codehs.com/info/curriculum/intropython

It's designed for high schoolers, but the first unit teaches Tracy the Turtle, which is a turtle graphics implementation in python in the browser that's really visual and accessible for younger students.

You learn to teach the turtle to move around the canvas and draw different shapes like this: enter image description here

Answered by Zach Galant on June 26, 2021

I agree with Peter. It needs to be fun, and games really help. It doesn't take much to exercise basic programming concepts such as variables, loops, selection, input, and output. I would start with simple games like Tic-Tac-Toe and Number Guessing Game. Implementing a simple AI would be fun. I've found that in-class programming contests work well too. For example, I've asked students to race to finish a fairly simple program. Another fun project is to use TkInter to allow students to play with graphics. Visual assignments tend to be more fun than stdout.

Answered by Edwin Torres on June 26, 2021

I have used 3 techniques.

  • Bottom up: teaching the parts and having them slowly able to create bigger programs. (This was the least good. It was not interesting, they did not learn as much. However it could be mixed with the others.)
  • Top down: I remind pupils that in Literature class they read poems and novels that they could not yet write. I then provide a working program, and get them to read it, and make guesses as to what bits do, and to change them. ”What happens if I change that?”
  • CodeHS (see @ZachGalant's answer. I first tried this after reading the answer). Pupils liked these lessons, and I got some good feedback on progress. However it stopped working (at school) in week 2. (Then it was the end of term.)
  • Avoid variables as long as possible: introduce parameterisation before mutation (a long way before), mutation should be one of the last things taught.

I also want to try ideas based on Bret Victor's ideas of direct manipulation, and immediate feedback: no compilation, no pressing run. Just change the code, and see the change.

Answered by ctrl-alt-delor on June 26, 2021

I am 12 and I can tell you what I did to learn Python. How I learned about Python was when I saw a video about a guy getting a wpm of 162 on a type-race-game, so I for some reason decided that I wanted to make a type-race-game. I knew about coding at the time, because my dad taught me HTML, when I was 9, but I did not like it, so I moved on.

When I was trying to learn how to code, I remembered the site codeacademy.com from when I was 9. I went to the website and there were many coding tutorials, for many different languages. I was looking through them and I saw Python. I remembered Python because my uncle (who works in IT) told me about it during the summer, so I decided to look at it. I looked at it for a while, but because of my ADHD, I couldn't sit there for long, so I kept hopping from site to site, mainly YouTube, to learn about Python. I used a site called repl.it as my IDE to code in Python.

After about 1 month, I figured out the basics like print and if. I could make a simple program, that when you say "hi" it says "hi" back. That is about it. 4 months of this went by of hopping from site to site learning about Python. It was finally Christmas that I got all the parts to build a computer, because my laptop was very slow and filled with viruses. It took almost 5 seconds just to load a site.

With my new computer it was faster to do stuff, and made learning way easier. Another 4 months went by and I was finally done. If you want to see it, here's the link https://repl.it/@Luke0/Writing-Game-1.

So my answer to that question is dedication, or just keep coming back to it, like I did. That is why it took me almost a year to learn.

Answered by user5999 on June 26, 2021

I've been in a similar situation. Like the other responders, I find that visual and game-related applications, often using high-level ideas like objects and methods/functions, will get and keep attention better than learning the "traditional" way from basic concepts like variables, operators, and control flow.

If your students like Minecraft (and haven't sold their soul's completely to Fortnite yet), you might look into some of the many activities online for modding Minecraft with Python.

Here's some examples: https://education.minecraft.net/lessons/teach-python-with-minecraft-pi/

https://projects.raspberrypi.org/en/projects/getting-started-with-minecraft-pi/5

https://nostarch.com/programwithminecraft

Answered by Matthew W. on June 26, 2021

Maybe do you want to try this:

Variables

  1. Organize plays around it, for example: to identify variables vs constants
  2. Organize puzzle to organize a complete function
  3. Divide your kids into small groups, and then give them a task, for example how to build a PC

Remember little kids understand playing over writing code

You can use platforms such as code.org software like scratch, why?

  1. Kids need first at all understand, what is logic, whats is programming languages
  2. If kids see this as an advendure they will be more agree to participate and practice

If you prefer you can use interactive videos to explain how code works, I mean:

Kids need to know

  1. How a computer proceses and work with variables and constants
  2. Maybe do you wanna demosntrate final products with that language to explain kids this "programming language is like lego pieces but in inspite if take with your hands pieces you write them"

Answered by user5980 on June 26, 2021

I see you've already accepted a great answer, but I'd like to give my knee-jerk reactions to your questions directly.

What I'm trying to ask here is, how do I get my mindset to their level?

In this question here we were talking about how to teach binary to 6-8 year-olds. What I said there I think touches on this question (I said a lot and am not going to repeat it here).

Very generally, what I do is assume nothing as far as previous knowledge and I especially try to keep things very goal/task focused, meaning, discussing what we want the computer to do, and the higher level ideas of how the computer does it. I only break things down into something more technical and specific when needed.

Language is especially important! Only introduce one term at a time and explain them thoroughly each time you add a new word to the jargon you want someone to understand. It actually helps to know, and use often, other (preferably simpler) terms while explaining an idea. For example, a variable is a "labeled box", or a "small dry erase board". A function is a "list of instructions". This actually brings me to your next question:

They struggle with understanding what a variable is, have trouble understanding flow of the program. What can I demonstrate to make them understand better?

Use as many real-world objects and analogies as possible. As I said above, variables are labeled boxes, cubbies, white boards, or any other object that holds information and can be emptied and refilled. Functions are just lists, and things like if statements can be thought of as "splits in a road" of instructions (or steps) your program is following.

I found it really useful when couching in college to use office workers (or any person doing any job) to represent objects and behaviors within a program. Personifying parts of a program can really help a lot in explaining how they work together.

... if it becomes a discussion about tracking the level of a game or the current high score ... -- Peter

It needs to be fun, and games really help. -- Edwin

Like the other responders, I find that visual and game-related applications ... will get and keep attention better than learning the "traditional" way ... -- Matthew

I really like all the talk of having kids make games in order to learn programming. When I was 14 and first learning C++ I made lots of little games too. I'd like to caution not to lose focus though. Regardless of what kind of program is being made that doesn't change how the teaching itself, the careful explanation of ideas, needs to be done. Please, make the packaging colorful and interesting, but keep in mind that concepts build on each other and need to be addressed in an order that makes sense and keeps questions flowing naturally.

Answered by RoboticForest on June 26, 2021

I taught kids Python last year, and I used "Python for Kids: A Playful Introduction To Programming" as a textbook.

But... Before I taught them Python, I taught them Scratch for several months so that they can grasp the basic concept of Scratch.

Then, I taught them how to type fast because I noticed that their typing skills are not up to be ready for coding. There are lots of fun typing game websites. Their favorite was nitrotype.com.

When I taught Python, I basically walked through the Python for Kids textbook, and made sure that they finished all the questions in the textbook. Kids really enjoyed the last project, Snake game, in the book.

My lecture notes on Python can be found here -- https://github.com/geekdojo-io

Answered by Jason Huh on June 26, 2021

The important thing to focus on is basic programming concepts. The language itself isn't as important at this early stage. I'll shamelessly promote my book, because it is appropriate here: The Super Simple Programming Book: Learn Basic Programming Concepts With Python.

It's a quick read, and it uses short and simple programs to teach the fundamental programming concepts like data, input/output, loops, decisions, etc. The book assumes no prior programming experience or knowledge. It uses a friendly and inviting tone as well. I must warn you that it isn't a good reference, because it doesn't aim to be. The goal is to quickly build a foundation, so students can continue their programming journeys on their own.

Answered by Edwin Torres on June 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP