Thursday, December 9, 2010

Warming up to Python Programming in the Classroom

Last month, I commented on Dan Meyer's blog dy/dan that I wasn't sure about using programming as part of teaching mathematics.  Dan had worked on a project of developing Python programs to be part of the mathematics curriculum.  This was part of a Google project on computational thinking.  I've played around with Python, and I like what I see so far.

I started writing a Python program as part of my toaster data collection.  I wasn't happy with using a die to choose the toaster settings because one setting came up more than the others.  Instead, I wanted to test all of the settings in a random order.

I have programmed enough to be able to implement this program in several different languages.  However, I didn't want to take the time to write it in C or Java.  I started to write a program on my TI-83, but that was too slow.  I remembered that my friend Shawn was working on learning Python, so I thought I would give it a try.  It took me half and hour to download Python, install it, and learn enough to get the result I wanted.  I would like to claim that a short development time was due to my genius.  However, it had to do with the random.shuffle() function which was built into the random module.

Now that I see how fast one can develop a program in Python, I am intrigued by the possibilities.  I am discovering that there are many third-party extensions that could be helpful in the classroom.  I am looking forward to exploring their use over Christmas.