Reflections on Teaching Python (The First 8 Weeks)
This school year I am teaching a brand new grade 11/12 elective computer programming course at my school here in Tokyo. We have finished two months of classes and I wanted to share and reflect on what we've done, why we've done it, and where we're going.
The Internet is literally awash in all types of materials for teaching programming from YouTube videos, to MOOCs, Codecademy, and well-known online resources such as Learn Python the Hard Way, Invent with Python, and Think Python. While each of these resources has its own strengths, I didn't feel that any one resource was exactly what my students needed. Thanks to a chance encounter and conversation at the Beyond Laptops conference with David Lee (@davidleeedtech), I settled on teaching Python through game programming (as also suggested in Invent with Python).
However, as most of the students had no programming background, I felt that the materials introduced too many concepts too quickly and with little instruction or context on how they could be used. Most materials focus on the syntax of programming without much thought into the thinking behind why a certain structure is used or how to approach programming problems.
This led me to having to make all of my own materials - an extremely time-consuming, but ultimately rewarding method that not only helped me grasp the Python programming language, but that also helped me explain the development process in a clear and step-by-step manner!
So far, we have worked on 5 Units:
1) Introduction (using the Terminal in Mac)
2) Input and Strings
3) Conditionals and Variable Types
Throughout these 8 weeks, we have worked on essentially 4 programs:
1) Mad Libs (Unit 2)
2) Math Calculations (Unit 3, Unit 4, Unit 5)
3) Guess the Number (Unit 3, Unit 4)
4) Rock, Paper, Scissors (Unit 3, Unit 4, and Unit 5)
Most programming materials and courses have students working on very different programs for every unit or chapter. I've always felt that this was a confusing way to teach programming especially for newbies, although I think it's great for those of us with some programming background and really just need to learn the language syntax.
The advantage of teaching new concepts with the same program is that you get to build on skills already learned and it is clear to students whether a program is working correctly or not as they have already had the program working previously and know what the output should look like. Each unit requires the application of a new programming feature on top of the previously laid foundation.
For example, when working on Rock, Paper, Scissors the progression went like this:
Unit 3 Conditionals and Variable Types : Play RPS against computer and manually restart after every attempt.
Unit 4 Loops : Play RPS against the computer until one side wins 3 times.
Unit 5 Functions : Play RPS against the computer until one side wins 3 times. Use functions to print the title, print the computer choice, and to determine the winner.
At each stage the program's complexity increases. It really helps the students concentrate on each facet of the program and once they've mastered one facet, they can move on and add to the program they've already created. Naturally, in the course of teaching how these games are programmed, we learned necessary ancillary concepts such as importing the os, random, and time modules. Although we've only touched on a few of the methods found in each module, we've laid the foundation for further exploration later.
So far, I have to say the students have been amazingly hard-working and dedicated. After each unit, students are asked to do a unit reflection, and thus far, they have been mostly positive as to the pacing and difficulty of the course. Although some students (and myself) are a bit bored with Rock, Paper, Scissors, the students see the value in learning the concepts by working on the same program and applying new concepts to it. That said, we are about to start working on Tic-Tac-Toe, where we will use all of the previous concepts, add Python lists, and program our first simple game AI.
Stay tuned for more!
Screenshot of my course Moodle page.
Recent blog posts
- Simple Python Game Tutorial Using Classes
- Video Tutorial: Python Spacewar Game
- Video Tutorial: Python To-Do-List (GUI Version)
- Video Tutorial: Simple Space Invaders Clone
- Video Tutorial: Python Functions with Turtle Graphics
- Video Tutorial: Python Guessing Game (GUI Version)
- Global Codeathon Scratch Tutorials
- Video Tutorial: A Simple Python Turtle Graphics Game
- Video Tutorial: Tic-Tac-Toe in Python
- In Favor of Standardization in Ed Tech