Introduction to Computation and Programming Using Python, second edition: With Application to Understanding Data
John Guttagamazon.com
Introduction to Computation and Programming Using Python, second edition: With Application to Understanding Data
When a function is called, a new symbol table (often called a stack frame) is created. This table keeps track of all names defined within the function (including the formal
Indexing can be used to extract individual characters from a string. In Python, all indexing is zero-based.
float is used to represent real numbers. Literals of type float always include a decimal point (e.g., 3.0 or 3.17 or -28.72). (It is also possible to write literals of type float using scientific notation. For example, the literal 1.6E3 stands for 1.6*103, i.e., it is the same as 1600.0.)
Many types of objects can be denoted by literals in the text of a program.
Declarative knowledge is composed of statements of fact. For example, “the square root of x is a number y such that y*y = x.” This is a statement of fact. Unfortunately, it doesn’t tell us anything about how to find a square root. Imperative knowledge is “how to” knowledge, or recipes for deducing information.
The primitive constructs in Python include literals (e.g., the number 3.2 and the string 'abc') and infix operators (e.g., + and /).