Summary
One of the main themes of this book is writing a program to simulate a computer so that you can run programs on a computer you designed yourself. To do this, it is necessary to write a simulator in a suitable high-level language. We chose Python because of its availability, simplicity, and power.
This chapter has provided a brief overview of Python by introducing the data structures and flow-control features you need to design a computer simulator. We have covered the basics of Python in sufficient detail for you to follow simple programs that don’t use any of Python’s more esoteric features.
Two important and very fundamental features of Python are the string (which is important, as simulation involves text processing) and the list. The list is simply a sequence of elements separated by commas and enclosed by square brackets. What is special about Python’s lists is that the elements can be any data elements, and they are easy to access – for...