Introduction to Python Programming

Here is a link to my sample Python code.

One of the somewhat unforeseen consequences of taking a career in applied mathematics, particularly in this day and age, is that you will eventually need to write computer programs that implement the mathematical algorithms. There are several languages in which one can do this, each with its own positives and negatives and you will find that things that are simple in some are difficult in another. After speaking with a number of people, both students and professionals who work with mathematics on a regular basis, I reasoned that it may be helpful to provide some source code examples to help mathematicians get started with programming in some of these languages. I decided to start with Python because its a powerful language, available for free, and its learning curve isn’t too steep.

I will be working with Python 2.7, which can be downloaded from https://www.python.org/download/releases/2.7/. I understand, however, that a limitation to coding is the required setup often necessary before one can even write their first line of code. So while I do encourage you to download Python, I will also provide a link to the online Python compiler at Compile Online, which should allow users to simply copy and paste the code into a new tab in their browser and by simply clicking the “Execute Script” command in the upper left corner, see the output of the code.

With that being said, here is a link to my sample Python code.

4 thoughts on “Introduction to Python Programming”

  1. Hello,
    I am currently teaching Python version 3.2 both at KS3 and GCSE. Can I suggest that you consider using Python 3.2 or higher because there are slight differences between 2.7, and in my experience 3.2 is now becoming more popular. If you are teaching Python 2.7 some of the syntax will not work in Python 3.2.

    A happy programmer!

    1. Thank you for commenting on my page. I am only familiar with Python 2.7 right now. I’ll work on developing more in 3.2 as you suggest though and I may come back and do a separate post on 3.2 if there is such a difference in the syntax. I chose to focus on 2.7 though because it is somewhat accepted as the standard Python version in the industry right now.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>