Introduction to Computation and Programming Using Python, second edition: With Application to Understanding Data
amazon.com
Introduction to Computation and Programming Using Python, second edition: With Application to Understanding Data
If p is a polynomial and r a real number, we will write p(r) to stand for the value of the polynomial when x = r. A root of the polynomial p is a solution to the equation p = 0, i.e., an r such that p(r) = 0. So, for example, the problem of finding an approximation to the square root of 24 can be formulated as finding an x such that x2 − 24 ≈ 0.
2.3.2 A Digression About Character Encoding
The while loops we have used so far are highly stylized. Each iterates over a sequence of integers. Python provides a language mechanism, the for loop, that can be used to simplify programs containing this kind of iteration. The general form of a for statement is (recall that the words in italics are descriptions of what can appear, not actual code
... See more3.4 A Few Words About Using Floats
3.3 Approximate Solutions and Bisection Search
In general, a recursive definition is made up of two parts. There is at least one base case that directly specifies the result for a special case (case 1 in the example above), and there is at least one recursive (inductive) case (cases 2 and 3 in the example above) that defines the answer in terms of the answer to the question on some other input,
... See more