Python was created by Guido van Rossum in 1990 to solve problems in the development of the Amoeba operating system. It is named after the British television show Monty Python’s Flying Circus. The use of Python has grown steadily over 1990’s to its current state where it is used in a variety of applications and environments.

Python is a interpreted, imperative, weakly-typed programming language. Unlike a compiled language, interpreted programming languages do not have to be compiled. Instead, the source file is translated (a.k.a. interpreted) by another program (the interpreter) when it is executed. Compiled languages, on the other hand, are executed directly by the computer. Since Python is a weakly-typed language, a variable can have different types during a program’s execution. For example, the variable a could represent a number, a string, and a list in succession in Python; this is not allowed in a strongly-typed language.

These notes assume a basic familiarity with programming concepts. In general, it is assumed one has had some programming experience in an object oriented language (such as C++). Concepts such as compiling, functions/procedures, dynamic memory, conditional statements, input/output, modular programming, namespaces, classes, objects, and inheritance should be familiar.

The examples in these notes will be given in Python 2.4. It is assumed that the reader has access to a a Python interpreter. The resources at the end of this document provide links to downloadable versions of the languages.

Outline
These notes will start with the basic foundations of an imperative programming language and build towards object-oriented design. This is done by first looking at procedural programming. Procedural programming will build naturally to modular programming and finally object-oriented programming.

Download pdf Using Python