I’ve been interested in learning python for a little while, and my new job on campus has finally forced me to take the initiative to do so – iTunes University uses python for a majority of the back-end coding, and with Binghamton trying to set up an iTunes U page, actually knowing python is a huge advantage. I picked up a book last week (“Python Programming for the Absolute Beginner” by Michael Dawson, ISBN-10: 1-59863-112-8), and have been diligently reading through it. At first glance, it seems like a very easy version of C – there are so many shortcuts that can be taken over the traditional C programming I’ve been doing, such as not defining a variable type (ie, int, char, *) and just being able to assign a value to it with the assignment defining it (marc = [] is a list, whereas marc = () is a tuple). As I was reading through and doing the examples, I realized that the list operator can easily be used to implement a stack, and by extension a queue. This reminded me of a lab I had to complete for my C programming class last semester, in which we had to create stacks and queues out of arrays, and then convert an infix (2+3) to a postfix (23+) expression. I decided to test out my understanding of Python up until this point and recreate the data structures and the conversion, leaving out the calculation portion. After a few bumps, I was able to successfully manipulate my stack, and with a few changes in the code, create the queue. The conversion took a little longer, but totaling only 78 lines, is definitely smaller than any C implementation I could create. Anyway, here’s the code and some download links for the files.