diff --git a/book/book.tex b/book/book.tex index e7d2326..56dfaee 100644 --- a/book/book.tex +++ b/book/book.tex @@ -1961,7 +1961,7 @@ \section{Function calls} \section{Math functions} \index{math function} -\index{function, math} +\index{function!math} Python has a math module that provides most of the familiar mathematical functions. A {\bf module} is a file that contains a @@ -2007,7 +2007,7 @@ \section{Math functions} \index{sine function} \index{radian} \index{trigonometric function} -\index{function, trigonometric} +\index{function!trigonometric} The second example finds the sine of {\tt radians}. The variable name {\tt radians} is a hint that {\tt sin} and the other trigonometric functions ({\tt cos}, {\tt tan}, etc.) take arguments in radians. To @@ -2028,7 +2028,7 @@ \section{Math functions} If you know trigonometry, you can check the previous result by comparing it to -the square root of two divided by two: +the square root of two, divided by two: \index{sqrt function} \index{function!sqrt} @@ -2454,8 +2454,8 @@ \section{Stack diagrams} \section{Fruitful functions and void functions} \index{fruitful function} \index{void function} -\index{function, fruitful} -\index{function, void} +\index{function!fruitful} +\index{function!void} Some of the functions we have used, such as the math functions, return results; for lack of a better name, I call them {\bf fruitful @@ -2522,7 +2522,7 @@ \section{Fruitful functions and void functions} \section{Why functions?} -\index{function, reasons for} +\index{function!reasons for} It may not be clear why it is worth the trouble to divide a program into functions. There are several reasons: @@ -2990,7 +2990,7 @@ \section{Simple repetition} \section{Exercises} -The following is a series of exercises using TurtleWorld. They +The following is a series of exercises using the {\tt turtle} module. They are meant to be fun, but they have a point, too. While you are working on them, think about what the point is. @@ -4375,7 +4375,7 @@ \section{Exercises} The following exercises use the {\tt turtle} module, described in Chapter~\ref{turtlechap}: -\index{TurtleWorld} +\index{turtle module} \begin{exercise} @@ -4617,7 +4617,7 @@ \section{Incremental development} % I chose these values so that the horizontal distance is 3 and the vertical distance is 4; that way, the result is 5, the hypotenuse -of a 3-4-5 triangle. When testing a function, it is +of a 3-4-5 right triangle. When testing a function, it is useful to know the right answer. \index{testing!knowing the answer} @@ -7402,7 +7402,7 @@ \section{Lists are mutable} Figure~\ref{fig.liststate} shows the state diagram for {\tt -cheeses}, {\tt numbers} and {\tt empty}: +cheeses}, {\tt numbers} and {\tt empty}. \index{state diagram} \index{diagram!state} @@ -8472,7 +8472,7 @@ \section{Exercises} \begin{exercise} \index{append method} -\index{method append} +\index{method!append} \index{list!concatenation} \index{concatenation!list} @@ -9696,7 +9696,7 @@ \section{Tuples as return values} \index{tuple} \index{value!tuple} \index{return value!tuple} -\index{function, tuple as return value} +\index{function!tuple as return value} Strictly speaking, a function can only return one value, but if the value is a tuple, the effect is the same as returning