Python Training Exercises

Overview of the Exercises

Most of the exercises in this class are based on a relatively simple problem area---that of working with simple data files such as CSV files. Many of the exercises involve working with some simple stock market data. This problem area has been chosen for a number of reasons:

  • It is a relatively simple concept.

  • It involves various aspects of data processing and data analysis.

  • It naturally lends itself to looking at different aspects of data representation, objects, and relationships between objects.

  • It has ties to different areas of systems programming—for instance, how to deal with real-time streaming stock quotes.

  • It can be used as basis for various internet programming applications.

  • It extends naturally into other problem domains including numerical programming, databases, graphical user interfaces, and performance tuning.

There are a few general themes that run throughout the exerices.

  • Different techniques for representing data. You will see different formulations of data structures, objects, and relationships between objects. A major goal of the exercises is for you to see many different approaches and for you to explore their tradeoffs.

  • Different ways of organizing programs. You will see the same problem solved in many different ways throughout the class. Again, the goal is to explore different approaches and their tradeoffs.

  • Solving problems in a ways that are portable, reliable, and efficient. Almost all of the exercises are cross platform (Windows/Unix). In addition, the exercises should work with any standard Python installation without the need for third party modules.

Almost every exercise has solution code that can be copied, modified, and studied. It is important to emphasize that certain exercises are more difficult than others and that there is only a limited amount of time to work each problem. Thus, you should not feel pressure to come up with your own solution to every single problem. Please look at the solutions as a guide and play around with them.

Critical Note

Many of the exercises in this class build upon previous exercises as you go along. If you have to step out of the class for a period or get stuck, please catch up by simply copying the posted solution code (look for the "Solution" link at the bottom of each page).

[ Back ]