Reflections on Teaching Python (The First 8 Weeks)

Python CodeThis 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.
 

Language Choice

After some deliberation over which programming language to start with, I settled on Python over other contenders such as JavaScript, Java, and PHP. All my Internet research led me to believe that Python was a great beginner's language and I have to say I agree.  The clear syntax and use of whitespace make it easy to visualize program flow and to enforce good coding standards.  The only challenge is that I am teaching myself the language ahead of my students! 

Materials

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!

Approach

So far, we have worked on 5 Units:

1) Introduction (using the Terminal in Mac)
2) Input and Strings
3) Conditionals and Variable Types
4) Loops
5) Functions

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.

Reflection

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!

ICS Moodle Page

Screenshot of my course Moodle page.

 

Comments

Great looking Moodle course

Hello there! I like the look of your Moodle course. I've been trying for ages to find people willing to share beginner computing course on Moodle.net our community hub http://moodle.net/ and it would be great if you could give it some thought - others teaching Python via Moodle would really benefit :)

I like your approach! Have

I like your approach! Have you looked at Mark Guzdial's Multimedia Programming with Python?

Not using games, obviously, but you may get some ideas. His Jython Environment for Students (JES) is a pretty slick concept.

http://coweb.cc.gatech.edu/mediaComp-teach#Python

 

Besides that, take a look at CodeSkulptor, and their recently added Viz mode, to see code "animated".

http://www.codeskulptor.org/

This could seriously help students get "unstuck" in debugging code, or simply getting it a bit more clearly in their heads!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.

@TokyoEdTech

Poll

What LMS does your school use?: