2
High-Speed Introduction to Python
This chapter introduces Python and demonstrates how to write a program in Python to solve the type of problem we described in Chapter 1. We are not going to delve deeply into Python in this chapter, but we will cover Python sufficiently to enable you to simulate and modify a computer to incorporate your own ideas.
Traditionally, a computer program has been compared to a cookery recipe because they are analogous. Strictly speaking, this statement applies only to procedural languages such as Python, Java, and C. Functional languages such as Lisp do not conform to this strictly sequential paradigm and are beyond the scope of this text
A recipe is a sequence of operations (i.e., actions or steps) that are carried out in order on the ingredients used by the recipe. A program is the same; it is a sequence of operations (instructions) that are carried out, in order, on data. The instructions of a program are carried out, one by one, sequentially...