# Think Python/Index

## Index

```{=html}
<TABLE CELLSPACING=6 CELLPADDING=0>
```
```{=html}
<TR>
```
```{=html}
<TD VALIGN=top ALIGN=left>
```
-

Ackerman function, 6.11

-   AttributeError, 15.7, A.2.3

```{=html}
<!-- -->
```
-   Austin, Jane, 13.3

```{=html}
<!-- -->
```
-   abecedarian, 8.3, 9.2

```{=html}
<!-- -->
```
-   abs function, 6.1

```{=html}
<!-- -->
```
-   absolute path, 14.4, 14.11

```{=html}
<!-- -->
```
-   access, 10.2

```{=html}
<!-- -->
```
-   accumulator, 10.14

```{=html}
<!-- -->
```
-

histogram, 13.3

-   list, 10.7

```{=html}
<!-- -->
```
-   string, 18.5

```{=html}
<!-- -->
```
-   sum, 10.7

```{=html}
<!-- -->
```
-   add method, 17.7

```{=html}
<!-- -->
```
-   addition with carrying, 7.6

```{=html}
<!-- -->
```
-   algorithm, 1.2, 1.7, 7.6, 13.7

```{=html}
<!-- -->
```
-

Euclid, 6.11

-   MD5, 14.12

```{=html}
<!-- -->
```
-   RSA, 11.7

```{=html}
<!-- -->
```
-   square root, 7.9

```{=html}
<!-- -->
```
-   aliasing, 10.10, 10.11, 10.14, 15.2, 15.6, 17.12

```{=html}
<!-- -->
```
-

copying to avoid, 10.13

-   alphabet, 4.12

```{=html}
<!-- -->
```
-   alternative execution, 5.5

```{=html}
<!-- -->
```
-   ambiguity, 1.4

```{=html}
<!-- -->
```
-   anagram, 10.15

```{=html}
<!-- -->
```
-   anagram set, 12.11, 14.7

```{=html}
<!-- -->
```
-   and operator, 5.3

```{=html}
<!-- -->
```
-   anydbm module, 14.6

```{=html}
<!-- -->
```
-   append method, 10.6, 10.12, 10.15, 18.4, 18.6

```{=html}
<!-- -->
```
-   arc function, 4.3

```{=html}
<!-- -->
```
-   argument, 3.1, 3.5, 3.8, 3.8, 3.14, 10.12

```{=html}
<!-- -->
```
-

gather, 12.4

-   keyword, 4.5, 4.11, 12.7, 19.2

```{=html}
<!-- -->
```
-   list, 10.12

```{=html}
<!-- -->
```
-   optional, 8.8, 10.9, 11.3

```{=html}
<!-- -->
```
-   variable-length tuple, 12.4

```{=html}
<!-- -->
```
-   argument scatter, 12.4

```{=html}
<!-- -->
```
-   arithmetic operator, 2.5

```{=html}
<!-- -->
```
-   assert statement, 16.5

```{=html}
<!-- -->
```
-   assignment, 2.11, 7.1, 10.1

```{=html}
<!-- -->
```
-

item, 8.5, 10.2, 12.1

-   multiple, 7.8, 11.6

```{=html}
<!-- -->
```
-   tuple, 12.2, 12.3, 12.5, 12.10

```{=html}
<!-- -->
```
-   assignment statement, 2.2

```{=html}
<!-- -->
```
-   attribute

```{=html}
<!-- -->
```
-

\_\_dict\_\_, 17.10

-   class, 18.2, 18.10

```{=html}
<!-- -->
```
-   initializing, 17.10

```{=html}
<!-- -->
```
-   instance, 15.2, 15.8, 18.2, 18.10

```{=html}
<!-- -->
```
-   available colors, 15.9, 17.12

\
\

-   Bacon, Kevin, 14.12

```{=html}
<!-- -->
```
-   Bangladesh, national flag, 15.9

```{=html}
<!-- -->
```
-   Button widget, 19.2

```{=html}
<!-- -->
```
-   base case, 5.9, 5.13

```{=html}
<!-- -->
```
-   benchmarking, 13.9, 13.11

```{=html}
<!-- -->
```
-   big, hairy expression, A.3.2

```{=html}
<!-- -->
```
-   binding, 19.8, 19.10

```{=html}
<!-- -->
```
-   bingo, 12.11

```{=html}
<!-- -->
```
-   birthday, 16.7

```{=html}
<!-- -->
```
-   birthday paradox, 10.15

```{=html}
<!-- -->
```
-   bisect module, 10.15

```{=html}
<!-- -->
```
-   bisection search, 10.15

```{=html}
<!-- -->
```
-   bisection, debugging by, 7.7

```{=html}
<!-- -->
```
-   bitwise operator, 2.5

```{=html}
<!-- -->
```
-   body, 3.5, 3.14, 5.13, 7.3

```{=html}
<!-- -->
```
-   bool type, 5.2

```{=html}
<!-- -->
```
-   boolean expression, 5.2, 5.13

```{=html}
<!-- -->
```
-   boolean function, 6.4, 16.1

```{=html}
<!-- -->
```
-   boolean operator, 8.9

```{=html}
<!-- -->
```
-   borrowing, subtraction with, 7.6, 16.4

```{=html}
<!-- -->
```
-   bound method, 19.6, 19.10

```{=html}
<!-- -->
```
-   bounding box, 15.9, 19.4, 19.10

```{=html}
<!-- -->
```
-   bracket

```{=html}
<!-- -->
```
-

squiggly, 11

-   bracket operator, 8.1, 10.2, 12.1

```{=html}
<!-- -->
```
-   branch, 5.5, 5.13

```{=html}
<!-- -->
```
-   break statement, 7.4

```{=html}
<!-- -->
```
-   bug, 1.3, 1.3, 1.7

```{=html}
<!-- -->
```
-

worst, 17.12

-   worst ever, 19.11

\
\

-   Callable object, 19.7

```{=html}
<!-- -->
```
-   Canvas coordinate, 19.3, 19.8

```{=html}
<!-- -->
```
-   Canvas item, 19.3

```{=html}
<!-- -->
```
-   Canvas object, 15.9

```{=html}
<!-- -->
```
-   Canvas widget, 19.3

```{=html}
<!-- -->
```
-   Car Talk, 9.7, 9.7, 9.7, 11.10, 12.11

```{=html}
<!-- -->
```
-   Card class, 18.1

```{=html}
<!-- -->
```
-   Collatz conjecture, 7.3

```{=html}
<!-- -->
```
-   Czech Republic, national flag, 15.9

```{=html}
<!-- -->
```
-   calculator, 1.8, 2.12

```{=html}
<!-- -->
```
-   call graph, 11.5, 11.9

```{=html}
<!-- -->
```
-   callback, 19.2, 19.6, 19.7, 19.8, 19.9, 19.10

```{=html}
<!-- -->
```
-   card, playing, 18

```{=html}
<!-- -->
```
-   carrying, addition with, 7.6, 16.2, 16.4

```{=html}
<!-- -->
```
-   case-sensitivity, variable names, 2.10

```{=html}
<!-- -->
```
-   catch, 14.11

```{=html}
<!-- -->
```
-   chained conditional, 5.6, 5.13

```{=html}
<!-- -->
```
-   character, 8.1

```{=html}
<!-- -->
```
-   checksum, 14.12

```{=html}
<!-- -->
```
-   child class, 18.7, 18.10

```{=html}
<!-- -->
```
-   choice function, 13.2

```{=html}
<!-- -->
```
-   circle function, 4.3

```{=html}
<!-- -->
```
-   circular definition, 6.5

```{=html}
<!-- -->
```
-   class, 15.1, 15.8

```{=html}
<!-- -->
```
-

Card, 18.1

-   Date, 16.7

```{=html}
<!-- -->
```
-   Deck, 18.4

```{=html}
<!-- -->
```
-   Hand, 18.7

```{=html}
<!-- -->
```
-   Kangaroo, 17.12

```{=html}
<!-- -->
```
-   Point, 15.1, 17.5

```{=html}
<!-- -->
```
-   parent, 18.7

```{=html}
<!-- -->
```
-   Rectangle, 15.3

```{=html}
<!-- -->
```
-   SimpleTurtleWorld, 19.6

```{=html}
<!-- -->
```
-   Time, 16.1

```{=html}
<!-- -->
```
-   class attribute, 18.2, 18.10

```{=html}
<!-- -->
```
-   class definition, 15.1

```{=html}
<!-- -->
```
-   class diagram, 18.8, 18.10

```{=html}
<!-- -->
```
-   class object, 15.1, 15.8

```{=html}
<!-- -->
```
-   close method, 14.2, 14.6, 14.8

```{=html}
<!-- -->
```
-   cmp function, 18.3

```{=html}
<!-- -->
```
-   \_\_cmp\_\_ method, 18.3

```{=html}
<!-- -->
```
-   colon, 3.5, A.1

```{=html}
<!-- -->
```
-   color list, 15.9, 17.12

```{=html}
<!-- -->
```
-   comment, 2.9, 2.11

```{=html}
<!-- -->
```
-   commutativity, 2.8, 17.8

```{=html}
<!-- -->
```
-   compare function, 6.1

```{=html}
<!-- -->
```
-   comparison

```{=html}
<!-- -->
```
-

string, 8.10

-   tuple, 12.7, 18.3

```{=html}
<!-- -->
```
-   comparison operator, 5.2

```{=html}
<!-- -->
```
-   compile, 1.1, 1.7

```{=html}
<!-- -->
```
-   composition, 3.4, 3.8, 3.14, 6.3, 18.4

```{=html}
<!-- -->
```
-   compound statement, 5.4, 5.13

```{=html}
<!-- -->
```
-   compression

```{=html}
<!-- -->
```
-

file, 14.8

-   concatenation, 2.8, 2.11, 3.9, 8.3, 8.5, 10.9

```{=html}
<!-- -->
```
-

list, 10.4, 10.12, 10.15

-   condition, 5.4, 5.13, 7.3, A.2.2

```{=html}
<!-- -->
```
-   conditional, A.1

```{=html}
<!-- -->
```
-

chained, 5.6, 5.13

-   nested, 5.7, 5.13

```{=html}
<!-- -->
```
-   conditional execution, 5.4

```{=html}
<!-- -->
```
-   conditional operator, 18.3

```{=html}
<!-- -->
```
-   conditional statement, 5.4, 5.13, 6.4

```{=html}
<!-- -->
```
-   config method, 19.3

```{=html}
<!-- -->
```
-   consistency check, 11.8, 16.4

```{=html}
<!-- -->
```
-   contributors, 0

```{=html}
<!-- -->
```
-   conversion

```{=html}
<!-- -->
```
-

type, 3.2

-   coordinate

```{=html}
<!-- -->
```
-

Canvas, 19.3, 19.8

-   pixel, 19.8

```{=html}
<!-- -->
```
-   coordinate sequence, 19.4

```{=html}
<!-- -->
```
-   copy

```{=html}
<!-- -->
```
-

deep, 15.6

-   shallow, 15.6

```{=html}
<!-- -->
```
-   slice, 8.4, 10.5

```{=html}
<!-- -->
```
-   to avoid aliasing, 10.13

```{=html}
<!-- -->
```
-   copy module, 15.6

```{=html}
<!-- -->
```
-   copying objects, 15.6

```{=html}
<!-- -->
```
-   count method, 8.8

```{=html}
<!-- -->
```
-   counter, 8.7, 8.12, 11.1, 11.6

```{=html}
<!-- -->
```
-   counting and looping, 8.7

```{=html}
<!-- -->
```
-   crosswords, 9.1

```{=html}
<!-- -->
```
-   cummings, e. e., 1.3.1

```{=html}
<!-- -->
```
-   cumulative sum, 10.7

\
\

-   Date class, 16.7

```{=html}
<!-- -->
```
-   Deck class, 18.4

```{=html}
<!-- -->
```
-   Dijkstra, Edsger, 9.5

```{=html}
<!-- -->
```
-   Doyle, Arthur Conan, 1.3.4

```{=html}
<!-- -->
```
-   DSU pattern, 12.7, 12.10, 13.4

```{=html}
<!-- -->
```
-   data structure, 12.9, 12.10, 13.9

```{=html}
<!-- -->
```
-   database, 14.6, 14.11, 14.12

```{=html}
<!-- -->
```
-   datetime module, 16.7

```{=html}
<!-- -->
```
-   dead code, 6.1, 6.10, A.2.4

```{=html}
<!-- -->
```
-   debugger (pdb), A.2.3

```{=html}
<!-- -->
```
-   debugging, 1.3, 1.3, 1.6, 1.7, 2.10, 3.13, 4.10, 5.12, 6.9, 8.11,
    9.5, 10.13, 11.8, 12.9, 13.10, 14.10, 15.7, 16.5, 17.10, 18.9, 19.9,
    A

```{=html}
<!-- -->
```
-

by bisection, 7.7

-   emotional response, 1.6, A.3.4

```{=html}
<!-- -->
```
-   experimental, 1.3.4

```{=html}
<!-- -->
```
-   superstition, A.3.4

```{=html}
<!-- -->
```
-   deck, playing cards, 18.4

```{=html}
<!-- -->
```
-   declaration, 11.6, 11.9

```{=html}
<!-- -->
```
-   decorate-sort-undecorate pattern, 12.7

```{=html}
<!-- -->
```
-   decrement, 7.2, 7.8

```{=html}
<!-- -->
```
-   deep copy, 15.6, 15.8

```{=html}
<!-- -->
```
-   deepcopy function, 15.6

```{=html}
<!-- -->
```
-   def keyword, 3.5

```{=html}
<!-- -->
```
-   default value, 13.5, 13.11, 17.5

```{=html}
<!-- -->
```
-

avoiding mutable, 17.12

-   definition

```{=html}
<!-- -->
```
-

circular, 6.5

-   class, 15.1

```{=html}
<!-- -->
```
-   function, 3.5

```{=html}
<!-- -->
```
-   recursive, 12.11

```{=html}
<!-- -->
```
-   del operator, 10.8

```{=html}
<!-- -->
```
-   deletion, element of list, 10.8

```{=html}
<!-- -->
```
-   delimiter, 10.9, 10.14

```{=html}
<!-- -->
```
-   deterministic, 13.2, 13.11

```{=html}
<!-- -->
```
-   development plan, 4.11

```{=html}
<!-- -->
```
-

encapsulation and generalization, 4.8

-   incremental, 6.2, A.1

```{=html}
<!-- -->
```
-   planned, 16.4

```{=html}
<!-- -->
```
-   problem recognition, 9.3, 9.4

```{=html}
<!-- -->
```
-   prototype and patch, 16.2, 16.4

```{=html}
<!-- -->
```
-   random walk programming, 13.10, A.3.4

```{=html}
<!-- -->
```
-   diagram

```{=html}
<!-- -->
```
-

call graph, 11.9

-   class, 18.8, 18.10

```{=html}
<!-- -->
```
-   object, 15.2, 15.3, 15.6, 15.8, 16.1, 18.2

```{=html}
<!-- -->
```
-   stack, 3.10, 10.12

```{=html}
<!-- -->
```
-   state, 2.2, 7.1, 8.11, 10.2, 10.10, 10.11, 11.4, 12.6, 15.2, 15.3,
    15.6, 16.1, 18.2

```{=html}
<!-- -->
```
-   \_\_dict\_\_ attribute, 17.10

```{=html}
<!-- -->
```
-   dict function, 11

```{=html}
<!-- -->
```
-   dictionary, 11, 11, 11.9, 12.6, A.2.3

```{=html}
<!-- -->
```
-

initialize, 12.6

-   invert, 11.4

```{=html}
<!-- -->
```
-   lookup, 11.3

```{=html}
<!-- -->
```
-   looping with, 11.2

```{=html}
<!-- -->
```
-   reverse lookup, 11.3

```{=html}
<!-- -->
```
-   subtraction, 13.6

```{=html}
<!-- -->
```
-   traversal, 12.6, 17.10

```{=html}
<!-- -->
```
-   dictionary methods

```{=html}
<!-- -->
```
-

anydbm module, 14.6

-   directory, 14.4, 14.11

```{=html}
<!-- -->
```
-

walk, 14.4

-   working, 14.4

```{=html}
<!-- -->
```
-   dispatch

```{=html}
<!-- -->
```
-

type-based, 17.9

-   dispatch, type-based, 17.8

```{=html}
<!-- -->
```
-   divisibility, 5.1

```{=html}
<!-- -->
```
-   division

```{=html}
<!-- -->
```
-

floating-point, 2.5

-   floor, 2.5, 5.12

```{=html}
<!-- -->
```
-   divmod, 12.3, 16.4

```{=html}
<!-- -->
```
-   docstring, 4.9, 4.11, 15.1

```{=html}
<!-- -->
```
-   documentation, 1.8

```{=html}
<!-- -->
```
-   dot notation, 3.3, 3.14, 8.8, 15.2, 17.2, 18.2

```{=html}
<!-- -->
```
-   double letters, 9.7

```{=html}
<!-- -->
```
-   drag-and-drop, 19.8

```{=html}
<!-- -->
```
-   duplicate, 10.15, 10.15, 11.10, 14.12

\
\

-   Einstein, Albert, 4.6

```{=html}
<!-- -->
```
-   Entry widget, 19.5

```{=html}
<!-- -->
```
-   Euclid's algorithm, 6.11

```{=html}
<!-- -->
```
-   Event object, 19.8

```{=html}
<!-- -->
```
-   element, 10.1, 10.14

```{=html}
<!-- -->
```
-   element deletion, 10.8

```{=html}
<!-- -->
```
-   elif keyword, 5.6

```{=html}
<!-- -->
```
-   ellipses, 3.5

```{=html}
<!-- -->
```
-   else keyword, 5.5

```{=html}
<!-- -->
```
-   email address, 12.2

```{=html}
<!-- -->
```
-   embedded object, 15.3, 15.8, 17.12

```{=html}
<!-- -->
```
-

copying, 15.6

-   emotional debugging, 1.6, A.3.4

```{=html}
<!-- -->
```
-   empty list, 10.1

```{=html}
<!-- -->
```
-   empty string, 8.12, 10.9

```{=html}
<!-- -->
```
-   encapsulation, 4.4, 4.11, 6.3, 7.5, 8.7, 18.7

```{=html}
<!-- -->
```
-   encode, 18.1, 18.10

```{=html}
<!-- -->
```
-   encrypt, 18.1

```{=html}
<!-- -->
```
-   encryption, 11.7

```{=html}
<!-- -->
```
-   end of line character, 14.10

```{=html}
<!-- -->
```
-   enumerate function, 12.5

```{=html}
<!-- -->
```
-   epsilon, 7.5

```{=html}
<!-- -->
```
-   equality and assignment, 7.1

```{=html}
<!-- -->
```
-   equivalence, 10.10

```{=html}
<!-- -->
```
-   equivalent, 10.14

```{=html}
<!-- -->
```
-   error

```{=html}
<!-- -->
```
-

compile-time, A

-   runtime, 1.3.2, 2.10, 5.10, 5.12, A

```{=html}
<!-- -->
```
-   semantic, 1.3.3, 2.1, 2.10, 8.11, A, A.3

```{=html}
<!-- -->
```
-   shape, 12.9

```{=html}
<!-- -->
```
-   syntax, 1.3.1, 2.10, A

```{=html}
<!-- -->
```
-   error checking, 6.8

```{=html}
<!-- -->
```
-   error message, 1.3.1, 1.3.3, 1.6, 2.1, 2.10, A.1

```{=html}
<!-- -->
```
-   eval function, 7.9

```{=html}
<!-- -->
```
-   evaluate, 2.6

```{=html}
<!-- -->
```
-   event, 19.10

```{=html}
<!-- -->
```
-   event handler, 19.8

```{=html}
<!-- -->
```
-   event loop, 19.1, 19.10

```{=html}
<!-- -->
```
-   event string, 19.8

```{=html}
<!-- -->
```
-   event-driven programming, 19.2, 19.9, 19.10

```{=html}
<!-- -->
```
-   exception, 1.3.2, 1.7, 2.10, A, A.2.3

```{=html}
<!-- -->
```
-

AttributeError, 15.7, A.2.3

-   IndexError, 8.2, 8.11, 10.2, A.2.3

```{=html}
<!-- -->
```
-   IOError, 14.5

```{=html}
<!-- -->
```
-   KeyError, 11, A.2.3

```{=html}
<!-- -->
```
-   NameError, 3.9, A.2.3

```{=html}
<!-- -->
```
-   OverflowError, 5.12

```{=html}
<!-- -->
```
-   RuntimeError, 5.10

```{=html}
<!-- -->
```
-   SyntaxError, 3.4

```{=html}
<!-- -->
```
-   TypeError, 8.1, 8.5, 11.4, 12.1, 12.4, 14.3, 17.3, A.2.3

```{=html}
<!-- -->
```
-   UnboundLocalError, 11.6

```{=html}
<!-- -->
```
-   ValueError, 5.11, 11.3, 12.2

```{=html}
<!-- -->
```
-   exception, catching, 14.5

```{=html}
<!-- -->
```
-   executable, 1.1, 1.7

```{=html}
<!-- -->
```
-   exercise, secret, 14.12

```{=html}
<!-- -->
```
-   exists function, 14.4

```{=html}
<!-- -->
```
-   experimental debugging, 1.3.4, 13.10

```{=html}
<!-- -->
```
-   expression, 2.5, 2.6, 2.11

```{=html}
<!-- -->
```
-

big and hairy, A.3.2

-   boolean, 5.2, 5.13

```{=html}
<!-- -->
```
-   extend method, 10.6

\
\

-   False special value, 5.2

```{=html}
<!-- -->
```
-   Fermat's Last Theorem, 5.14

```{=html}
<!-- -->
```
-   Frame widget, 19.6

```{=html}
<!-- -->
```
-   Free Documentation License, GNU, 0, 0

```{=html}
<!-- -->
```
-   factorial function, 6.5, 6.8

```{=html}
<!-- -->
```
-   fibonacci function, 6.7, 11.5

```{=html}
<!-- -->
```
-   file, 14

```{=html}
<!-- -->
```
-

compression, 14.8

-   permission, 14.5

```{=html}
<!-- -->
```
-   reading and writing, 14.2

```{=html}
<!-- -->
```
-   file object, 9.1, 9.6

```{=html}
<!-- -->
```
-   filename, 14.4

```{=html}
<!-- -->
```
-   filter pattern, 10.7, 10.14

```{=html}
<!-- -->
```
-   find function, 8.6

```{=html}
<!-- -->
```
-   flag, 11.6, 11.9

```{=html}
<!-- -->
```
-   float function, 3.2

```{=html}
<!-- -->
```
-   float type, 2.1

```{=html}
<!-- -->
```
-   floating-point, 2.11, 7.5

```{=html}
<!-- -->
```
-   floating-point division, 2.5

```{=html}
<!-- -->
```
-   floor division, 2.5, 2.11, 5.12

```{=html}
<!-- -->
```
-   flow of execution, 3.7, 3.14, 6.7, 6.9, 7.3, 18.9, 19.9, A.2.2

```{=html}
<!-- -->
```
-   flower, 4.12

```{=html}
<!-- -->
```
-   folder, 14.4

```{=html}
<!-- -->
```
-   for loop, 4.2, 8.3, 10.3, 12.5

```{=html}
<!-- -->
```
-   formal language, 1.4, 1.7

```{=html}
<!-- -->
```
-   format operator, 14.3, 14.11, A.2.3

```{=html}
<!-- -->
```
-   format sequence, 14.3, 14.11

```{=html}
<!-- -->
```
-   format string, 14.3, 14.11

```{=html}
<!-- -->
```
-   frabjuous, 6.5

```{=html}
<!-- -->
```
-   frame, 3.10, 3.14, 5.9, 6.5, 11.5

```{=html}
<!-- -->
```
-   frequency, 11.1

```{=html}
<!-- -->
```
-

letter, 12.11

-   word, 13.1, 13.12

```{=html}
<!-- -->
```
-   fruitful function, 3.11, 3.14

```{=html}
<!-- -->
```
-   frustration, A.3.4

```{=html}
<!-- -->
```
-   function, 3.5, 3.14, 17.1

```{=html}
<!-- -->
```
-

abs, 6.1

-   ack, 6.11

```{=html}
<!-- -->
```
-   arc, 4.3

```{=html}
<!-- -->
```
-   choice, 13.2

```{=html}
<!-- -->
```
-   circle, 4.3

```{=html}
<!-- -->
```
-   cmp, 18.3

```{=html}
<!-- -->
```
-   compare, 6.1

```{=html}
<!-- -->
```
-   deepcopy, 15.6

```{=html}
<!-- -->
```
-   dict, 11

```{=html}
<!-- -->
```
-   enumerate, 12.5

```{=html}
<!-- -->
```
-   eval, 7.9

```{=html}
<!-- -->
```
-   exists, 14.4

```{=html}
<!-- -->
```
-   factorial, 6.5

```{=html}
<!-- -->
```
-   fibonacci, 6.7, 11.5

```{=html}
<!-- -->
```
-   find, 8.6

```{=html}
<!-- -->
```
-   float, 3.2

```{=html}
<!-- -->
```
-   getattr, 17.10

```{=html}
<!-- -->
```
-   getcwd, 14.4

```{=html}
<!-- -->
```
-   hasattr, 15.7, 17.10

```{=html}
<!-- -->
```
-   int, 3.2

```{=html}
<!-- -->
```
-   isinstance, 6.8, 17.8

```{=html}
<!-- -->
```
-   len, 3.15, 8.2, 11

```{=html}
<!-- -->
```
-   list, 10.9

```{=html}
<!-- -->
```
-   log, 3.3

```{=html}
<!-- -->
```
-   max, 12.3, 12.4

```{=html}
<!-- -->
```
-   min, 12.3, 12.4

```{=html}
<!-- -->
```
-   open, 9.1, 9.1, 14.2, 14.5, 14.6

```{=html}
<!-- -->
```
-   polygon, 4.3

```{=html}
<!-- -->
```
-   popen, 14.8

```{=html}
<!-- -->
```
-   randint, 10.15, 13.2

```{=html}
<!-- -->
```
-   random, 12.7, 13.2

```{=html}
<!-- -->
```
-   raw_input, 5.11

```{=html}
<!-- -->
```
-   recursive, 5.8

```{=html}
<!-- -->
```
-   reload, 14.9, A.1.1

```{=html}
<!-- -->
```
-   repr, 14.10

```{=html}
<!-- -->
```
-   reversed, 12.8

```{=html}
<!-- -->
```
-   shuffle, 18.6

```{=html}
<!-- -->
```
-   sorted, 12.8

```{=html}
<!-- -->
```
-   sqrt, 3.3, 6.2

```{=html}
<!-- -->
```
-   str, 3.2

```{=html}
<!-- -->
```
-   sum, 12.4

```{=html}
<!-- -->
```
-   tuple, 12.1

```{=html}
<!-- -->
```
-   type, 15.7

```{=html}
<!-- -->
```
-   zip, 12.5

```{=html}
<!-- -->
```
-   function argument, 3.8

```{=html}
<!-- -->
```
-   function call, 3.1, 3.14

```{=html}
<!-- -->
```
-   function composition, 6.3

```{=html}
<!-- -->
```
-   function definition, 3.5, 3.6, 3.14, 3.14

```{=html}
<!-- -->
```
-   function frame, 3.10, 3.14, 5.9, 11.5

```{=html}
<!-- -->
```
-   function object, 3.5, 3.15

```{=html}
<!-- -->
```
-   function parameter, 3.8

```{=html}
<!-- -->
```
-   function syntax, 17.2

```{=html}
<!-- -->
```
-   function type

```{=html}
<!-- -->
```
-

modifier, 16.3

-   pure, 16.2

```{=html}
<!-- -->
```
-   function, fruitful, 3.11

```{=html}
<!-- -->
```
-   function, math, 3.3

```{=html}
<!-- -->
```
-   function, reasons for, 3.12

```{=html}
<!-- -->
```
-   function, trigonometric, 3.3

```{=html}
<!-- -->
```
-   function, tuple as return value, 12.3

```{=html}
<!-- -->
```
-   function, void, 3.11

```{=html}
<!-- -->
```
-   functional programming style, 16.3, 16.6

\
\

-   GCD (greatest common divisor), 6.11

```{=html}
<!-- -->
```
-   GNU Free Documentation License, 0, 0

```{=html}
<!-- -->
```
-   GUI, 19.1, 19.10

```{=html}
<!-- -->
```
-   Gui module, 19.1

```{=html}
<!-- -->
```
-   gamma function, 6.8

```{=html}
<!-- -->
```
-   gather, 12.4, 12.10

```{=html}
<!-- -->
```
-   generalization, 4.5, 4.11, 9.3, 16.4

```{=html}
<!-- -->
```
-   geometry manager, 19.6, 19.10

```{=html}
<!-- -->
```
-   get method, 11.1

```{=html}
<!-- -->
```
-   getattr function, 17.10

```{=html}
<!-- -->
```
-   getcwd function, 14.4

```{=html}
<!-- -->
```
-   global statement, 11.6

```{=html}
<!-- -->
```
-   global variable, 11.6, 11.9

```{=html}
<!-- -->
```
-

update, 11.6

-   graphical user interface, 19.1

```{=html}
<!-- -->
```
-   greatest common divisor (GCD), 6.11

```{=html}
<!-- -->
```
-   grid, 3.15

```{=html}
<!-- -->
```
-   guardian pattern, 6.8, 6.10, 8.11

```{=html}
<!-- -->
```
-   gzip (Unix command), 14.8

\
\

-   HAS-A relationship, 18.8, 18.10

```{=html}
<!-- -->
```
-   Hand class, 18.7

```{=html}
<!-- -->
```
-   Hello, World, 1.5

```{=html}
<!-- -->
```
-   Holmes, Sherlock, 1.3.4

```{=html}
<!-- -->
```
-   HTMLParser module, 19.11

```{=html}
<!-- -->
```
-   hanging, A.2.2

```{=html}
<!-- -->
```
-   hasattr function, 15.7, 17.10

```{=html}
<!-- -->
```
-   hash function, 11.4, 11.9

```{=html}
<!-- -->
```
-   hashable, 11.4, 11.9, 12.6

```{=html}
<!-- -->
```
-   hashtable, 11, 11.9

```{=html}
<!-- -->
```
-   header, 3.5, 3.14, A.1

```{=html}
<!-- -->
```
-   help utility, 1.8

```{=html}
<!-- -->
```
-   hexadecimal, 15.1

```{=html}
<!-- -->
```
-   high-level language, 1.1, 1.7

```{=html}
<!-- -->
```
-   histogram, 11.1, 11.1, 11.9

```{=html}
<!-- -->
```
-

random choice, 13.2, 13.7

-   word frequencies, 13.3

```{=html}
<!-- -->
```
-   homophone, 11.10

```{=html}
<!-- -->
```
-   hyperlink, 19.11

```{=html}
<!-- -->
```
-   hypotenuse, 6.2

\
\

-   IMDb (Internet Movie Database), 14.12

```{=html}
<!-- -->
```
-   Image module, 19.11

```{=html}
<!-- -->
```
-   IndexError, 8.2, 8.11, 10.2, A.2.3

```{=html}
<!-- -->
```
-   Internet Movie Database (IMDb), 14.12

```{=html}
<!-- -->
```
-   IOError, 14.5

```{=html}
<!-- -->
```
-   IS-A relationship, 18.8, 18.10

```{=html}
<!-- -->
```
-   identical, 10.14

```{=html}
<!-- -->
```
-   identity, 10.10

```{=html}
<!-- -->
```
-   if statement, 5.4

```{=html}
<!-- -->
```
-   image viewer, 19.11

```{=html}
<!-- -->
```
-   immutability, 8.5, 8.5, 8.12, 10.11, 11.4, 12.1, 12.8

```{=html}
<!-- -->
```
-   implementation, 11.1, 11.9, 13.9

```{=html}
<!-- -->
```
-   import statement, 3.14, 4.1, 14.9

```{=html}
<!-- -->
```
-   in operator, 8.9, 9.3, 10.2, 11

```{=html}
<!-- -->
```
-   increment, 7.2, 7.8, 16.3, 17.3

```{=html}
<!-- -->
```
-   incremental development, 6.10, A.1

```{=html}
<!-- -->
```
-   indentation, 3.5, 17.2, A.1

```{=html}
<!-- -->
```
-   index, 8.1, 8.1, 8.11, 8.12, 10.2, 10.14, 11, A.2.3

```{=html}
<!-- -->
```
-

looping with, 9.4, 10.3

-   negative, 8.2

```{=html}
<!-- -->
```
-   slice, 8.4, 10.5

```{=html}
<!-- -->
```
-   starting at zero, 8.1, 10.2

```{=html}
<!-- -->
```
-   infinite loop, 7.3, 7.8, 19.1, A.2.2, A.2.2

```{=html}
<!-- -->
```
-   infinite recursion, 5.10, 5.13, 6.8, A.2.2, A.2.2

```{=html}
<!-- -->
```
-   inheritance, 18.7, 18.10

```{=html}
<!-- -->
```
-   init method, 17.5, 17.10, 18.1, 18.4, 18.7

```{=html}
<!-- -->
```
-   initialization (before update), 7.2

```{=html}
<!-- -->
```
-   instance, 4.1, 4.11, 15.1, 15.8

```{=html}
<!-- -->
```
-

as argument, 15.2

-   as return value, 15.4

```{=html}
<!-- -->
```
-   instance attribute, 15.2, 15.8, 18.2, 18.10

```{=html}
<!-- -->
```
-   instantiation, 15.1

```{=html}
<!-- -->
```
-   int function, 3.2

```{=html}
<!-- -->
```
-   int type, 2.1

```{=html}
<!-- -->
```
-   integer, 2.11

```{=html}
<!-- -->
```
-

long, 11.7

-   interactive mode, 1.1, 1.7, 2.4, 3.11

```{=html}
<!-- -->
```
-   interface, 4.6, 4.10, 4.11, 18.9

```{=html}
<!-- -->
```
-   interlocking words, 10.15

```{=html}
<!-- -->
```
-   interpret, 1.1, 1.7

```{=html}
<!-- -->
```
-   invariant, 16.5, 16.6, 19.9

```{=html}
<!-- -->
```
-   invert dictionary, 11.4

```{=html}
<!-- -->
```
-   invocation, 8.8, 8.12

```{=html}
<!-- -->
```
-   is operator, 10.10, 15.6

```{=html}
<!-- -->
```
-   isinstance function, 6.8, 17.8

```{=html}
<!-- -->
```
-   item, 8.12, 10.1

```{=html}
<!-- -->
```
-

Canvas, 19.3, 19.10

-   dictionary, 11.9

```{=html}
<!-- -->
```
-   item assignment, 8.5, 10.2, 12.1

```{=html}
<!-- -->
```
-   item update, 10.3

```{=html}
<!-- -->
```
-   items method, 12.6

```{=html}
<!-- -->
```
-   iteration, 7, 7.3, 7.8

\
\

-   join method, 10.9, 18.5

\
\

-   Kangaroo class, 17.12

```{=html}
<!-- -->
```
-   Kevin Bacon Game, 14.12

```{=html}
<!-- -->
```
-   KeyError, 11, A.2.3

```{=html}
<!-- -->
```
-   Koch curve, 5.14

```{=html}
<!-- -->
```
-   key, 11, 11.9

```{=html}
<!-- -->
```
-   key-value pair, 11, 11.9, 12.6

```{=html}
<!-- -->
```
-   keyboard input, 5.11

```{=html}
<!-- -->
```
-   keys method, 11.2

```{=html}
<!-- -->
```
-   keyword, 2.3, 2.3, 2.11, A.1

```{=html}
<!-- -->
```
-

def, 3.5

-   elif, 5.6

```{=html}
<!-- -->
```
-   else, 5.5

```{=html}
<!-- -->
```
-   keyword argument, 4.5, 4.11, 12.7, 19.2, 19.10

\
\

-   Label widget, 19.2

```{=html}
<!-- -->
```
-   Linux, 1.3.4

```{=html}
<!-- -->
```
-   language

```{=html}
<!-- -->
```
-

formal, 1.4

-   high-level, 1.1

```{=html}
<!-- -->
```
-   low-level, 1.1

```{=html}
<!-- -->
```
-   natural, 1.4

```{=html}
<!-- -->
```
-   programming, 1.1

```{=html}
<!-- -->
```
-   safe, 1.3.2

```{=html}
<!-- -->
```
-   Turing complete, 6.5

```{=html}
<!-- -->
```
-   leap of faith, 6.6

```{=html}
<!-- -->
```
-   len function, 3.15, 8.2, 11

```{=html}
<!-- -->
```
-   letter frequency, 12.11

```{=html}
<!-- -->
```
-   letter rotation, 8.13, 11.10

```{=html}
<!-- -->
```
-   lipogram, 9.2

```{=html}
<!-- -->
```
-   list, 10, 10.9, 10.14, 12.8

```{=html}
<!-- -->
```
-

as argument, 10.12

-   comprehension, 10.7

```{=html}
<!-- -->
```
-   concatenation, 10.4, 10.12, 10.15

```{=html}
<!-- -->
```
-   copy, 10.5

```{=html}
<!-- -->
```
-   element, 10.2

```{=html}
<!-- -->
```
-   empty, 10.1

```{=html}
<!-- -->
```
-   function, 10.9

```{=html}
<!-- -->
```
-   index, 10.2

```{=html}
<!-- -->
```
-   membership, 10.2

```{=html}
<!-- -->
```
-   method, 10.6

```{=html}
<!-- -->
```
-   nested, 10.1, 10.3

```{=html}
<!-- -->
```
-   of objects, 18.4

```{=html}
<!-- -->
```
-   of tuples, 12.5

```{=html}
<!-- -->
```
-   operation, 10.4

```{=html}
<!-- -->
```
-   repetition, 10.4

```{=html}
<!-- -->
```
-   slice, 10.5

```{=html}
<!-- -->
```
-   traversal, 10.3, 10.14

```{=html}
</TD>
```
```{=html}
<TD VALIGN=top ALIGN=left>
```
-   literalness, 1.4

```{=html}
<!-- -->
```
-   local variable, 3.9, 3.14

```{=html}
<!-- -->
```
-   log function, 3.3

```{=html}
<!-- -->
```
-   logarithm, 13.12

```{=html}
<!-- -->
```
-   logical operator, 5.2, 5.3

```{=html}
<!-- -->
```
-   long integer, 11.7

```{=html}
<!-- -->
```
-   lookup, 11.9

```{=html}
<!-- -->
```
-   lookup, dictionary, 11.3

```{=html}
<!-- -->
```
-   loop, 4.2, 4.11, 7.3, 12.5

```{=html}
<!-- -->
```
-

condition, A.2.2

-   event, 19.1

```{=html}
<!-- -->
```
-   for, 4.2, 8.3, 10.3

```{=html}
<!-- -->
```
-   infinite, 7.3, 19.1, A.2.2

```{=html}
<!-- -->
```
-   nested, 18.4

```{=html}
<!-- -->
```
-   traversal, 8.3

```{=html}
<!-- -->
```
-   while, 7.3

```{=html}
<!-- -->
```
-   looping

```{=html}
<!-- -->
```
-

with dictionaries, 11.2

-   with indices, 9.4

```{=html}
<!-- -->
```
-   with strings, 8.7

```{=html}
<!-- -->
```
-   looping and counting, 8.7

```{=html}
<!-- -->
```
-   looping with indices, 10.3

```{=html}
<!-- -->
```
-   low-level language, 1.1, 1.7

```{=html}
<!-- -->
```
-   ls (Unix command), 14.8

\
\

-   Markov analysis, 13.8

```{=html}
<!-- -->
```
-   McCloskey, Robert, 8.3

```{=html}
<!-- -->
```
-   MD5 algorithm, 14.12

```{=html}
<!-- -->
```
-   Menubutton widget, 19.7

```{=html}
<!-- -->
```
-   Monty Python and the Holy Grail, 16.2

```{=html}
<!-- -->
```
-   MP3, 14.12

```{=html}
<!-- -->
```
-   map pattern, 10.7, 10.14

```{=html}
<!-- -->
```
-   map to, 18.1

```{=html}
<!-- -->
```
-   mapping, 10.2, 10.14, 13.8

```{=html}
<!-- -->
```
-   mash-up, 13.8

```{=html}
<!-- -->
```
-   math function, 3.3

```{=html}
<!-- -->
```
-   max function, 12.3, 12.4

```{=html}
<!-- -->
```
-   membership

```{=html}
<!-- -->
```
-

bisection search, 10.15

-   dictionary, 11

```{=html}
<!-- -->
```
-   list, 10.2

```{=html}
<!-- -->
```
-   set, 11

```{=html}
<!-- -->
```
-   memo, 11.5, 11.9

```{=html}
<!-- -->
```
-   mental model, A.3.1

```{=html}
<!-- -->
```
-   metaphor, method invocation, 17.2

```{=html}
<!-- -->
```
-   metathesis, 12.11

```{=html}
<!-- -->
```
-   method, 8.8, 8.12, 17.1, 17.11

```{=html}
<!-- -->
```
-

\_\_cmp\_\_, 18.3

-   \_\_str\_\_, 17.6, 18.5

```{=html}
<!-- -->
```
-   add, 17.7

```{=html}
<!-- -->
```
-   append, 10.6, 10.12, 18.4, 18.6

```{=html}
<!-- -->
```
-   close, 14.2, 14.6, 14.8

```{=html}
<!-- -->
```
-   config, 19.3

```{=html}
<!-- -->
```
-   count, 8.8

```{=html}
<!-- -->
```
-   extend, 10.6

```{=html}
<!-- -->
```
-   get, 11.1

```{=html}
<!-- -->
```
-   init, 17.5, 18.1, 18.4, 18.7

```{=html}
<!-- -->
```
-   items, 12.6

```{=html}
<!-- -->
```
-   join, 10.9, 18.5

```{=html}
<!-- -->
```
-   keys, 11.2

```{=html}
<!-- -->
```
-   mro, 18.9

```{=html}
<!-- -->
```
-   pop, 10.8, 18.6

```{=html}
<!-- -->
```
-   radd, 17.8

```{=html}
<!-- -->
```
-   read, 14.8

```{=html}
<!-- -->
```
-   readline, 9.1, 14.8

```{=html}
<!-- -->
```
-   remove, 10.8

```{=html}
<!-- -->
```
-   replace, 13.1

```{=html}
<!-- -->
```
-   setdefault, 11.4

```{=html}
<!-- -->
```
-   sort, 10.6, 10.13, 12.7, 18.6

```{=html}
<!-- -->
```
-   split, 10.9, 12.2

```{=html}
<!-- -->
```
-   string, 8.13

```{=html}
<!-- -->
```
-   strip, 9.1, 13.1

```{=html}
<!-- -->
```
-   translate, 13.1

```{=html}
<!-- -->
```
-   update, 12.6

```{=html}
<!-- -->
```
-   values, 11

```{=html}
<!-- -->
```
-   void, 10.6

```{=html}
<!-- -->
```
-   method append, 10.15

```{=html}
<!-- -->
```
-   method resolution order, 18.9

```{=html}
<!-- -->
```
-   method syntax, 17.2

```{=html}
<!-- -->
```
-   method, bound, 19.6

```{=html}
<!-- -->
```
-   method, list, 10.6

```{=html}
<!-- -->
```
-   min function, 12.3, 12.4

```{=html}
<!-- -->
```
-   model, mental, A.3.1

```{=html}
<!-- -->
```
-   modifier, 16.3, 16.6

```{=html}
<!-- -->
```
-   module, 3.3, 3.14, 3.14

```{=html}
<!-- -->
```
-

anydbm, 14.6

-   bisect, 10.15

```{=html}
<!-- -->
```
-   copy, 15.6

```{=html}
<!-- -->
```
-   datetime, 16.7

```{=html}
<!-- -->
```
-   Gui, 19.1

```{=html}
<!-- -->
```
-   HTMLParser, 19.11

```{=html}
<!-- -->
```
-   Image, 19.11

```{=html}
<!-- -->
```
-   os, 14.4

```{=html}
<!-- -->
```
-   pickle, 14.1, 14.7

```{=html}
<!-- -->
```
-   pprint, 11.8

```{=html}
<!-- -->
```
-   profile, 13.9

```{=html}
<!-- -->
```
-   random, 10.15, 12.7, 13.2, 18.6

```{=html}
<!-- -->
```
-   reload, 14.9, A.1.1

```{=html}
<!-- -->
```
-   shelve, 14.7, 14.12

```{=html}
<!-- -->
```
-   string, 13.1

```{=html}
<!-- -->
```
-   structshape, 12.9

```{=html}
<!-- -->
```
-   urllib, 14.12, 19.11

```{=html}
<!-- -->
```
-   Visual, 17.12

```{=html}
<!-- -->
```
-   vpython, 17.12

```{=html}
<!-- -->
```
-   World, 15.9

```{=html}
<!-- -->
```
-   module object, 3.3, 14.9

```{=html}
<!-- -->
```
-   module, writing, 14.9

```{=html}
<!-- -->
```
-   modulus operator, 5.1, 5.13

```{=html}
<!-- -->
```
-   mro method, 18.9

```{=html}
<!-- -->
```
-   multiline string, 4.9, A.1

```{=html}
<!-- -->
```
-   multiple assignment, 7.1, 7.8, 11.6

```{=html}
<!-- -->
```
-   multiplicity (in class diagram), 18.8, 18.10

```{=html}
<!-- -->
```
-   mutability, 8.5, 10.2, 10.5, 10.11, 11.6, 12.1, 12.8, 15.5

```{=html}
<!-- -->
```
-   mutable object, as default value, 17.12

\
\

-   NameError, 3.9, A.2.3

```{=html}
<!-- -->
```
-   Newton's method, 7.5

```{=html}
<!-- -->
```
-   None special value, 3.11, 6.1, 6.10, 10.6, 10.8

```{=html}
<!-- -->
```
-   natural language, 1.4, 1.7

```{=html}
<!-- -->
```
-   negative index, 8.2

```{=html}
<!-- -->
```
-   nested conditional, 5.7, 5.13

```{=html}
<!-- -->
```
-   nested list, 10.1, 10.3, 10.14

```{=html}
<!-- -->
```
-   newline, 5.11, 7.1, 18.5

```{=html}
<!-- -->
```
-   not operator, 5.3

```{=html}
<!-- -->
```
-   number, random, 13.2

\
\

-   OverflowError, 5.12

```{=html}
<!-- -->
```
-   object, 8.5, 8.12, 10.10, 10.10, 10.14, 15.1

```{=html}
<!-- -->
```
-

Callable, 19.7

-   Canvas, 15.9

```{=html}
<!-- -->
```
-   class, 15.1

```{=html}
<!-- -->
```
-   copying, 15.6

```{=html}
<!-- -->
```
-   Event, 19.8

```{=html}
<!-- -->
```
-   embedded, 15.3, 15.8, 17.12

```{=html}
<!-- -->
```
-   file, 9.1, 9.6

```{=html}
<!-- -->
```
-   function, 3.5, 3.15

```{=html}
<!-- -->
```
-   module, 14.9

```{=html}
<!-- -->
```
-   mutable, 15.5

```{=html}
<!-- -->
```
-   printing, 17.2

```{=html}
<!-- -->
```
-   object code, 1.1, 1.7

```{=html}
<!-- -->
```
-   object diagram, 15.2, 15.3, 15.6, 15.8, 16.1, 18.2

```{=html}
<!-- -->
```
-   object-oriented language, 17.11

```{=html}
<!-- -->
```
-   object-oriented programming, 17.1, 17.11, 18.7

```{=html}
<!-- -->
```
-   octal, 2.2

```{=html}
<!-- -->
```
-   odometer, 9.7

```{=html}
<!-- -->
```
-   open function, 9.1, 9.1, 14.2, 14.5, 14.6

```{=html}
<!-- -->
```
-   operand, 2.5, 2.11

```{=html}
<!-- -->
```
-   operator, 2.11

```{=html}
<!-- -->
```
-

and, 5.3

-   bitwise, 2.5

```{=html}
<!-- -->
```
-   boolean, 8.9

```{=html}
<!-- -->
```
-   bracket, 8.1, 10.2, 12.1

```{=html}
<!-- -->
```
-   comparison, 5.2

```{=html}
<!-- -->
```
-   conditional, 18.3

```{=html}
<!-- -->
```
-   del, 10.8

```{=html}
<!-- -->
```
-   format, 14.3, 14.11, A.2.3

```{=html}
<!-- -->
```
-   in, 8.9, 9.3, 10.2, 11

```{=html}
<!-- -->
```
-   is, 10.10, 15.6

```{=html}
<!-- -->
```
-   logical, 5.2, 5.3

```{=html}
<!-- -->
```
-   modulus, 5.1, 5.13

```{=html}
<!-- -->
```
-   not, 5.3

```{=html}
<!-- -->
```
-   or, 5.3

```{=html}
<!-- -->
```
-   overloading, 17.11

```{=html}
<!-- -->
```
-   slice, 8.4, 8.13, 10.5, 10.12, 12.1

```{=html}
<!-- -->
```
-   string, 2.8

```{=html}
<!-- -->
```
-   update, 10.7

```{=html}
<!-- -->
```
-   operator overloading, 17.7, 18.3

```{=html}
<!-- -->
```
-   operator, arithmetic, 2.5

```{=html}
<!-- -->
```
-   option, 19.2, 19.10

```{=html}
<!-- -->
```
-   optional argument, 8.8, 10.9, 11.3

```{=html}
<!-- -->
```
-   optional parameter, 13.5, 17.5

```{=html}
<!-- -->
```
-   or operator, 5.3

```{=html}
<!-- -->
```
-   order of operations, 2.7, 2.10, A.3.2

```{=html}
<!-- -->
```
-   os module, 14.4

```{=html}
<!-- -->
```
-   other (parameter name), 17.4

```{=html}
<!-- -->
```
-   overloading, 17.11

```{=html}
<!-- -->
```
-   override, 13.5, 13.11, 17.5, 18.3, 18.7, 18.9

\
\

-   PEMDAS, 2.7

```{=html}
<!-- -->
```
-   PIL (Python Imaging Library), 19.11

```{=html}
<!-- -->
```
-   Point class, 15.1, 17.5

```{=html}
<!-- -->
```
-   Project Gutenberg, 13.1

```{=html}
<!-- -->
```
-   Puzzler, 9.7, 9.7, 9.7, 11.10, 12.11

```{=html}
<!-- -->
```
-   Pythagorean theorem, 6.2

```{=html}
<!-- -->
```
-   Python 3.0, 1.5, 2.5, 5.11, 11.7, 12.5

```{=html}
<!-- -->
```
-   Python debugger (pdb), A.2.3

```{=html}
<!-- -->
```
-   Python Imaging Library (PIL), 19.11

```{=html}
<!-- -->
```
-   packing widgets, 19.6, 19.10

```{=html}
<!-- -->
```
-   palindrome, 6.11, 8.13, 9.4, 9.7, 9.7

```{=html}
<!-- -->
```
-   parameter, 3.8, 3.9, 3.14, 10.12

```{=html}
<!-- -->
```
-

gather, 12.4

-   optional, 13.5, 17.5

```{=html}
<!-- -->
```
-   other, 17.4

```{=html}
<!-- -->
```
-   self, 17.2

```{=html}
<!-- -->
```
-   parent class, 18.7, 18.7, 18.10

```{=html}
<!-- -->
```
-   parentheses

```{=html}
<!-- -->
```
-

argument in, 3.1

-   empty, 3.5, 8.8

```{=html}
<!-- -->
```
-   matching, 1.3.1

```{=html}
<!-- -->
```
-   overriding precedence, 2.7

```{=html}
<!-- -->
```
-   parameters in, 3.8, 3.9

```{=html}
<!-- -->
```
-   parent class in, 18.7

```{=html}
<!-- -->
```
-   tuples in, 12.1

```{=html}
<!-- -->
```
-   parse, 1.4, 1.7, 14.12

```{=html}
<!-- -->
```
-   pass statement, 5.4

```{=html}
<!-- -->
```
-   path, 14.4, 14.11

```{=html}
<!-- -->
```
-

absolute, 14.4

-   relative, 14.4

```{=html}
<!-- -->
```
-   pattern

```{=html}
<!-- -->
```
-

DSU, 12.7, 13.4

-   decorate-sort-undecorate, 12.7

```{=html}
<!-- -->
```
-   filter, 10.7, 10.14

```{=html}
<!-- -->
```
-   guardian, 6.8, 6.10, 8.11

```{=html}
<!-- -->
```
-   map, 10.7, 10.14

```{=html}
<!-- -->
```
-   reduce, 10.7, 10.14

```{=html}
<!-- -->
```
-   search, 8.6, 8.12, 9.3, 11.3

```{=html}
<!-- -->
```
-   swap, 12.2

```{=html}
<!-- -->
```
-   pdb (Python debugger), A.2.3

```{=html}
<!-- -->
```
-   permission, file, 14.5

```{=html}
<!-- -->
```
-   persistence, 14.1, 14.11

```{=html}
<!-- -->
```
-   pi, 3.3, 7.9

```{=html}
<!-- -->
```
-   pickle module, 14.1, 14.7

```{=html}
<!-- -->
```
-   pickling, 14.7

```{=html}
<!-- -->
```
-   pie, 4.12

```{=html}
<!-- -->
```
-   pipe, 14.8, 14.12

```{=html}
<!-- -->
```
-   pixel coordinate, 19.8

```{=html}
<!-- -->
```
-   plain text, 9.1, 13.1, 14.12, 19.11

```{=html}
<!-- -->
```
-   planned development, 16.4, 16.6

```{=html}
<!-- -->
```
-   playing card, Anglo-American, 18

```{=html}
<!-- -->
```
-   poetry, 1.4

```{=html}
<!-- -->
```
-   point, mathematical, 15.1

```{=html}
<!-- -->
```
-   poker, 18, 18.11

```{=html}
<!-- -->
```
-   polygon function, 4.3

```{=html}
<!-- -->
```
-   polymorphism, 17.9, 17.11, 18.9

```{=html}
<!-- -->
```
-   pop method, 10.8, 18.6

```{=html}
<!-- -->
```
-   popen function, 14.8

```{=html}
<!-- -->
```
-   portability, 1.1, 1.7

```{=html}
<!-- -->
```
-   postcondition, 4.10, 6.9, 18.9

```{=html}
<!-- -->
```
-   pprint module, 11.8

```{=html}
<!-- -->
```
-   precedence, 2.11, A.3.2

```{=html}
<!-- -->
```
-   precondition, 4.10, 4.11, 4.11, 6.9, 10.15, 18.9

```{=html}
<!-- -->
```
-   prefix, 13.8

```{=html}
<!-- -->
```
-   pretty print, 11.8

```{=html}
<!-- -->
```
-   print statement, 1.5, 1.7, 17.6, A.2.4

```{=html}
<!-- -->
```
-   problem recognition, 9.3, 9.4, 9.6

```{=html}
<!-- -->
```
-   problem solving, 1, 1.7

```{=html}
<!-- -->
```
-   profile module, 13.9

```{=html}
<!-- -->
```
-   program, 1.2, 1.7

```{=html}
<!-- -->
```
-   program testing, 9.5

```{=html}
<!-- -->
```
-   programming language, 1.1

```{=html}
<!-- -->
```
-   prompt, 1.1, 1.7, 5.11

```{=html}
<!-- -->
```
-   prose, 1.4

```{=html}
<!-- -->
```
-   prototype and patch, 16.2, 16.4, 16.6

```{=html}
<!-- -->
```
-   pseudorandom, 13.2, 13.11

```{=html}
<!-- -->
```
-   pure function, 16.2, 16.6

```{=html}
<!-- -->
```
-   python.org, 1.8

\
\

-   quotation mark, 1.5, 2.1, 2.1, 4.9, 8.4, A.1

\
\

-   Ramanujan, Srinivasa, 7.9

```{=html}
<!-- -->
```
-   Rectangle class, 15.3

```{=html}
<!-- -->
```
-   RSA algorithm, 11.7

```{=html}
<!-- -->
```
-   RuntimeError, 5.10, 6.8

```{=html}
<!-- -->
```
-   radd method, 17.8

```{=html}
<!-- -->
```
-   radian, 3.3

```{=html}
<!-- -->
```
-   rage, A.3.4

```{=html}
<!-- -->
```
-   raise statement, 11.3, 16.5

```{=html}
<!-- -->
```
-   randint function, 10.15, 13.2

```{=html}
<!-- -->
```
-   random function, 12.7, 13.2

```{=html}
<!-- -->
```
-   random module, 10.15, 12.7, 13.2, 18.6

```{=html}
<!-- -->
```
-   random number, 13.2

```{=html}
<!-- -->
```
-   random text, 13.8

```{=html}
<!-- -->
```
-   random walk programming, 13.10, A.3.4

```{=html}
<!-- -->
```
-   rank, 18.1

```{=html}
<!-- -->
```
-   raw_input function, 5.11

```{=html}
<!-- -->
```
-   read method, 14.8

```{=html}
<!-- -->
```
-   readline method, 9.1, 14.8

```{=html}
<!-- -->
```
-   recursion, 5.8, 5.8, 5.13, 6.5, 6.6

```{=html}
<!-- -->
```
-

base case, 5.9

-   infinite, 5.10, 6.8, A.2.2

```{=html}
<!-- -->
```
-   recursive definition, 6.5, 12.11

```{=html}
<!-- -->
```
-   reduce pattern, 10.7, 10.14

```{=html}
<!-- -->
```
-   reducible word, 11.10, 12.11

```{=html}
<!-- -->
```
-   redundancy, 1.4

```{=html}
<!-- -->
```
-   refactoring, 4.7, 4.7

```{=html}
<!-- -->
```
-   reference, 10.11, 10.12, 10.14

```{=html}
<!-- -->
```
-

aliasing, 10.11

-   relative path, 14.4, 14.11

```{=html}
<!-- -->
```
-   reload function, 14.9, A.1.1

```{=html}
<!-- -->
```
-   remove method, 10.8

```{=html}
<!-- -->
```
-   repetition, 4.2

```{=html}
<!-- -->
```
-

list, 10.4

-   replace method, 13.1

```{=html}
<!-- -->
```
-   repr function, 14.10

```{=html}
<!-- -->
```
-   representation, 15.1, 15.3, 18.1

```{=html}
<!-- -->
```
-   return statement, 5.8, 6.1, A.3.3

```{=html}
<!-- -->
```
-   return value, 3.1, 3.14, 6.1, 15.4

```{=html}
<!-- -->
```
-

tuple, 12.3

-   reverse lookup, dictionary, 11.3, 11.9

```{=html}
<!-- -->
```
-   reverse word pair, 10.15

```{=html}
<!-- -->
```
-   reversed function, 12.8

```{=html}
<!-- -->
```
-   rotation

```{=html}
<!-- -->
```
-

letters, 11.10

-   rotation, letter, 8.13

```{=html}
<!-- -->
```
-   rules of precedence, 2.7, 2.11

```{=html}
<!-- -->
```
-   running pace, 1.8, 2.12, 16.7

```{=html}
<!-- -->
```
-   runtime error, 1.3.2, 2.10, 5.10, 5.12, A, A.2.3

\
\

-   Scrabble, 12.11

```{=html}
<!-- -->
```
-   SimpleTurtleWorld class, 19.6

```{=html}
<!-- -->
```
-   SVG, 19.11

```{=html}
<!-- -->
```
-   Swampy, 4.1, 9.1, 15.9, 18.11, 19.1

```{=html}
<!-- -->
```
-   SyntaxError, 3.4

```{=html}
<!-- -->
```
-   safe language, 1.3.2

```{=html}
<!-- -->
```
-   sanity check, 11.8

```{=html}
<!-- -->
```
-   scaffolding, 6.2, 6.10, 11.8

```{=html}
<!-- -->
```
-   scatter, 12.4, 12.10

```{=html}
<!-- -->
```
-   script, 1.1, 1.7

```{=html}
<!-- -->
```
-   script mode, 1.1, 1.7, 2.4, 3.11

```{=html}
<!-- -->
```
-   search, 11.3

```{=html}
<!-- -->
```
-   search pattern, 8.6, 8.12, 9.3

```{=html}
<!-- -->
```
-   search, bisection, 10.15

```{=html}
<!-- -->
```
-   secret exercise, 14.12

```{=html}
<!-- -->
```
-   self (parameter name), 17.2

```{=html}
<!-- -->
```
-   semantic error, 1.3.3, 1.7, 2.1, 2.10, 8.11, A, A.3

```{=html}
<!-- -->
```
-   semantics, 1.3.3, 1.7, 17.1

```{=html}
<!-- -->
```
-   sequence, 8.1, 8.12, 10.1, 10.9, 12.1, 12.8

```{=html}
<!-- -->
```
-

coordinate, 19.4

-   set, 13.6

```{=html}
<!-- -->
```
-

anagram, 12.11, 14.7

-   set membership, 11

```{=html}
<!-- -->
```
-   setdefault method, 11.4

```{=html}
<!-- -->
```
-   sexagesimal, 16.4

```{=html}
<!-- -->
```
-   shallow copy, 15.6, 15.8

```{=html}
<!-- -->
```
-   shape, 12.10

```{=html}
<!-- -->
```
-   shape error, 12.9

```{=html}
<!-- -->
```
-   shell, 14.8

```{=html}
<!-- -->
```
-   shelve module, 14.7, 14.12

```{=html}
<!-- -->
```
-   shuffle function, 18.6

```{=html}
<!-- -->
```
-   sine function, 3.3

```{=html}
<!-- -->
```
-   singleton, 11.4, 11.9, 12.1

```{=html}
<!-- -->
```
-   slice, 8.12

```{=html}
<!-- -->
```
-

copy, 8.4, 10.5

-   list, 10.5

```{=html}
<!-- -->
```
-   string, 8.4

```{=html}
<!-- -->
```
-   tuple, 12.1

```{=html}
<!-- -->
```
-   update, 10.5

```{=html}
<!-- -->
```
-   slice operator, 8.4, 8.13, 10.5, 10.12, 12.1

```{=html}
<!-- -->
```
-   sort method, 10.6, 10.13, 12.7, 18.6

```{=html}
<!-- -->
```
-   sorted function, 12.8

```{=html}
<!-- -->
```
-   source code, 1.1, 1.7

```{=html}
<!-- -->
```
-   special case, 9.5, 9.6, 16.3

```{=html}
<!-- -->
```
-   special value

```{=html}
<!-- -->
```
-

False, 5.2

-   None, 3.11, 6.1, 6.10, 10.6, 10.8

```{=html}
<!-- -->
```
-   True, 5.2

```{=html}
<!-- -->
```
-   split method, 10.9, 12.2

```{=html}
<!-- -->
```
-   sqrt, 6.2

```{=html}
<!-- -->
```
-   sqrt function, 3.3

```{=html}
<!-- -->
```
-   square root, 7.5

```{=html}
<!-- -->
```
-   squiggly bracket, 11

```{=html}
<!-- -->
```
-   stack diagram, 3.10, 3.10, 3.14, 4.12, 5.9, 6.5, 6.11, 10.12

```{=html}
<!-- -->
```
-   state diagram, 2.2, 2.11, 7.1, 8.11, 10.2, 10.10, 10.11, 11.4, 12.6,
    15.2, 15.3, 15.6, 16.1, 18.2

```{=html}
<!-- -->
```
-   statement, 2.4, 2.11

```{=html}
<!-- -->
```
-

assert, 16.5

-   assignment, 2.2, 7.1

```{=html}
<!-- -->
```
-   break, 7.4

```{=html}
<!-- -->
```
-   compound, 5.4

```{=html}
<!-- -->
```
-   conditional, 5.4, 5.13, 6.4

```{=html}
<!-- -->
```
-   for, 4.2, 8.3, 10.3

```{=html}
<!-- -->
```
-   global, 11.6

```{=html}
<!-- -->
```
-   if, 5.4

```{=html}
<!-- -->
```
-   import, 3.14, 4.1, 14.9

```{=html}
<!-- -->
```
-   pass, 5.4

```{=html}
<!-- -->
```
-   print, 1.5, 1.7, 17.6, A.2.4

```{=html}
<!-- -->
```
-   raise, 11.3, 16.5

```{=html}
<!-- -->
```
-   return, 5.8, 6.1, A.3.3

```{=html}
<!-- -->
```
-   try, 14.5

```{=html}
<!-- -->
```
-   while, 7.3

```{=html}
<!-- -->
```
-   step size, 8.13

```{=html}
<!-- -->
```
-   str function, 3.2

```{=html}
<!-- -->
```
-   \_\_str\_\_ method, 17.6, 18.5

```{=html}
<!-- -->
```
-   string, 2.1, 2.11, 10.9, 12.8

```{=html}
<!-- -->
```
-

accumulator, 18.5

-   comparison, 8.10

```{=html}
<!-- -->
```
-   empty, 10.9

```{=html}
<!-- -->
```
-   immutable, 8.5

```{=html}
<!-- -->
```
-   method, 8.8

```{=html}
<!-- -->
```
-   multiline, 4.9, A.1

```{=html}
<!-- -->
```
-   operation, 2.8

```{=html}
<!-- -->
```
-   slice, 8.4

```{=html}
<!-- -->
```
-   triple-quoted, 4.9

```{=html}
<!-- -->
```
-   string method, 8.13

```{=html}
<!-- -->
```
-   string module, 13.1

```{=html}
<!-- -->
```
-   string representation, 14.10, 17.6

```{=html}
<!-- -->
```
-   string type, 2.1

```{=html}
<!-- -->
```
-   strip method, 9.1, 13.1

```{=html}
<!-- -->
```
-   structshape module, 12.9

```{=html}
<!-- -->
```
-   structure, 1.4

```{=html}
<!-- -->
```
-   subclass, 18.7

```{=html}
<!-- -->
```
-   subject, 17.2, 17.11, 19.6

```{=html}
<!-- -->
```
-   subtraction

```{=html}
<!-- -->
```
-

dictionary, 13.6

-   with borrowing, 7.6

```{=html}
<!-- -->
```
-   subtraction with borrowing, 16.4

```{=html}
<!-- -->
```
-   suffix, 13.8

```{=html}
<!-- -->
```
-   suit, 18.1

```{=html}
<!-- -->
```
-   sum function, 12.4

```{=html}
<!-- -->
```
-   superclass, 18.7

```{=html}
<!-- -->
```
-   superstitious debugging, A.3.4

```{=html}
<!-- -->
```
-   swap pattern, 12.2

```{=html}
<!-- -->
```
-   syntax, 1.3.1, 1.3.1, 1.7, 17.1, A.1

```{=html}
<!-- -->
```
-   syntax error, 1.3.1, 1.7, 2.10, A

\
\

-   Tagger, 18.11

```{=html}
<!-- -->
```
-   Text widget, 19.5

```{=html}
<!-- -->
```
-   Time class, 16.1

```{=html}
<!-- -->
```
-   Tkinter, 19.1

```{=html}
<!-- -->
```
-   True special value, 5.2

```{=html}
<!-- -->
```
-   Turing complete language, 6.5

```{=html}
<!-- -->
```
-   Turing Thesis, 6.5

```{=html}
<!-- -->
```
-   Turing, Alan, 6.5

```{=html}
<!-- -->
```
-   TurtleWorld, 4.1, 5.14, 18.11

```{=html}
<!-- -->
```
-   TypeError, 8.1, 8.5, 11.4, 12.1, 12.4, 14.3, 17.3, A.2.3

```{=html}
<!-- -->
```
-   temporary variable, 6.1, 6.10, A.3.2

```{=html}
<!-- -->
```
-   test case, minimal, A.2.4

```{=html}
<!-- -->
```
-   testing

```{=html}
<!-- -->
```
-

and absence of bugs, 9.5

-   incremental development, 6.2

```{=html}
<!-- -->
```
-   interactive mode, 1.1

```{=html}
<!-- -->
```
-   is hard, 9.5

```{=html}
<!-- -->
```
-   knowing the answer, 6.2

```{=html}
<!-- -->
```
-   leap of faith, 6.6

```{=html}
<!-- -->
```
-   minimal test case, A.2.4

```{=html}
<!-- -->
```
-   text

```{=html}
<!-- -->
```
-

plain, 9.1, 13.1, 14.12, 19.11

-   random, 13.8

```{=html}
<!-- -->
```
-   text file, 14.11

```{=html}
<!-- -->
```
-   token, 1.4, 1.7

```{=html}
<!-- -->
```
-   traceback, 3.10, 3.14, 5.10, 5.12, 11.3, A.2.3

```{=html}
<!-- -->
```
-   translate method, 13.1

```{=html}
<!-- -->
```
-   traversal, 8.3, 8.3, 8.6, 8.11, 8.12, 9.3, 9.3, 10.7, 10.14, 11.1,
    11.2, 12.5, 12.5, 12.7, 13.3

```{=html}
<!-- -->
```
-

dictionary, 17.10

-   list, 10.3

```{=html}
<!-- -->
```
-   traverse

```{=html}
<!-- -->
```
-

dictionary, 12.6

-   triangle, 5.14

```{=html}
<!-- -->
```
-   trigonometric function, 3.3

```{=html}
<!-- -->
```
-   triple-quoted string, 4.9

```{=html}
<!-- -->
```
-   try statement, 14.5

```{=html}
<!-- -->
```
-   tuple, 12.1, 12.3, 12.8, 12.10

```{=html}
<!-- -->
```
-

as key in dictionary, 12.6, 13.9

-   assignment, 12.2

```{=html}
<!-- -->
```
-   comparison, 12.7, 18.3

```{=html}
<!-- -->
```
-   in brackets, 12.6

```{=html}
<!-- -->
```
-   singleton, 12.1

```{=html}
<!-- -->
```
-   slice, 12.1

```{=html}
<!-- -->
```
-   tuple assignment, 12.3, 12.5, 12.10

```{=html}
<!-- -->
```
-   tuple function, 12.1

```{=html}
<!-- -->
```
-   turtle typewriter, 4.12

```{=html}
<!-- -->
```
-   type, 2.1, 2.1, 2.11

```{=html}
<!-- -->
```
-

bool, 5.2

-   dict, 11

```{=html}
<!-- -->
```
-   file, 14

```{=html}
<!-- -->
```
-   float, 2.1

```{=html}
<!-- -->
```
-   int, 2.1

```{=html}
<!-- -->
```
-   list, 10

```{=html}
<!-- -->
```
-   long, 11.7

```{=html}
<!-- -->
```
-   set, 13.6

```{=html}
<!-- -->
```
-   str, 2.1

```{=html}
<!-- -->
```
-   tuple, 12.1

```{=html}
<!-- -->
```
-   user-defined, 15.1, 16.1

```{=html}
<!-- -->
```
-   type checking, 6.8

```{=html}
<!-- -->
```
-   type conversion, 3.2

```{=html}
<!-- -->
```
-   type function, 15.7

```{=html}
<!-- -->
```
-   type-based dispatch, 17.8, 17.9, 17.11

```{=html}
<!-- -->
```
-   typewriter, turtle, 4.12

```{=html}
<!-- -->
```
-   typographical error, 13.10

\
\

-   UML, 18.8

```{=html}
<!-- -->
```
-   UnboundLocalError, 11.6

```{=html}
<!-- -->
```
-   Unix command

```{=html}
<!-- -->
```
-

gzip, 14.8

-   ls, 14.8

```{=html}
<!-- -->
```
-   URL, 14.12, 19.11

```{=html}
<!-- -->
```
-   underscore character, 2.3

```{=html}
<!-- -->
```
-   uniqueness, 10.15

```{=html}
<!-- -->
```
-   update, 7.2, 7.5, 7.8

```{=html}
<!-- -->
```
-

coordinate, 19.8

-   database, 14.6

```{=html}
<!-- -->
```
-   global variable, 11.6

```{=html}
<!-- -->
```
-   histogram, 13.3

```{=html}
<!-- -->
```
-   item, 10.3

```{=html}
<!-- -->
```
-   slice, 10.5

```{=html}
<!-- -->
```
-   update method, 12.6

```{=html}
<!-- -->
```
-   update operator, 10.7

```{=html}
<!-- -->
```
-   urllib module, 14.12, 19.11

```{=html}
<!-- -->
```
-   use before def, 2.10, 3.6

```{=html}
<!-- -->
```
-   user-defined type, 15.1, 16.1

\
\

-   ValueError, 5.11, 11.3, 12.2

```{=html}
<!-- -->
```
-   Visual module, 17.12

```{=html}
<!-- -->
```
-   value, 2.1, 2.11, 10.10, 10.10, 11.9

```{=html}
<!-- -->
```
-

default, 13.5

-   tuple, 12.3

```{=html}
<!-- -->
```
-   values method, 11

```{=html}
<!-- -->
```
-   variable, 2.2, 2.11

```{=html}
<!-- -->
```
-

global, 11.6

-   local, 3.9

```{=html}
<!-- -->
```
-   temporary, 6.1, 6.10, A.3.2

```{=html}
<!-- -->
```
-   updating, 7.2

```{=html}
<!-- -->
```
-   variable-length argument tuple, 12.4

```{=html}
<!-- -->
```
-   vector graphics, 19.11

```{=html}
<!-- -->
```
-   veneer, 18.6, 18.10

```{=html}
<!-- -->
```
-   void function, 3.11, 3.14

```{=html}
<!-- -->
```
-   void method, 10.6

```{=html}
<!-- -->
```
-   vpython module, 17.12

\
\

-   World module, 15.9

```{=html}
<!-- -->
```
-   walk, directory, 14.4

```{=html}
<!-- -->
```
-   while loop, 7.3

```{=html}
<!-- -->
```
-   whitespace, 3.13, 5.12, 9.1, 14.10, A.1

```{=html}
<!-- -->
```
-   widget, 19.1, 19.10

```{=html}
<!-- -->
```
-

Button, 19.2

-   Canvas, 19.3

```{=html}
<!-- -->
```
-   Entry, 19.5

```{=html}
<!-- -->
```
-   Frame, 19.6

```{=html}
<!-- -->
```
-   Label, 19.2

```{=html}
<!-- -->
```
-   Menubutton, 19.7

```{=html}
<!-- -->
```
-   Text, 19.5

```{=html}
<!-- -->
```
-   widget, packing, 19.6

```{=html}
<!-- -->
```
-   word count, 14.9

```{=html}
<!-- -->
```
-   word frequency, 13.1, 13.12

```{=html}
<!-- -->
```
-   word, reducible, 11.10, 12.11

```{=html}
<!-- -->
```
-   working directory, 14.4

```{=html}
<!-- -->
```
-   worst bug, 17.12

```{=html}
<!-- -->
```
-

ever, 19.11

\
\

-   Zipf's law, 13.12

```{=html}
<!-- -->
```
-   zero, index starting at, 8.1, 10.2

```{=html}
<!-- -->
```
-   zip function, 12.5

```{=html}
<!-- -->
```
-

use with dict, 12.6

```{=html}
</TD>
```
```{=html}
</TR>
```
```{=html}
</TABLE>
```
```{=html}
<HR>
```


# Algorithms/Introduction

This book covers techniques for the design and analysis of algorithms.
The algorithmic techniques covered include: divide and conquer,
backtracking, dynamic programming, greedy algorithms, and hill-climbing.

Any solvable problem generally has at least one algorithm of each of the
following types:

1.  the obvious way;
2.  the methodical way;
3.  the clever way; and
4.  the miraculous way.

On the first and most basic level, the \"obvious\" solution might try to
exhaustively search for the answer. Intuitively, the obvious solution is
the one that comes easily if you\'re familiar with a programming
language and the basic problem solving techniques.

The second level is the methodical level and is the heart of this book:
after understanding the material presented here you should be able to
methodically turn most obvious algorithms into better performing
algorithms.

The third level, the clever level, requires more understanding of the
elements involved in the problem and their properties or even a
reformulation of the algorithm (e.g., numerical algorithms exploit
mathematical properties that are not obvious). A clever algorithm may be
hard to understand by being non-obvious that it is correct, or it may be
hard to understand that it actually runs faster than what it would seem
to require.

The fourth and final level of an algorithmic solution is the miraculous
level: this is reserved for the rare cases where a breakthrough results
in a highly non-intuitive solution.

Naturally, all of these four levels are relative, and some clever
algorithms are covered in this book as well, in addition to the
methodical techniques. Let\'s begin.

## Prerequisites

To understand the material presented in this book you need to know a
programming language well enough to translate the pseudocode in this
book into a working solution. You also need to know the basics about the
following data structures: arrays, stacks, queues, linked-lists, trees,
heaps (also called priority queues), disjoint sets, and graphs.

Additionally, you should know some basic algorithms like binary search,
a sorting algorithm (merge sort, heap sort, insertion sort, or others),
and breadth-first or depth-first search.

If you are unfamiliar with any of these prerequisites you should review
the material in the *Data
Structures* book first.

## When is Efficiency Important?

Not every problem requires the most efficient solution available. For
our purposes, the term efficient is concerned with the time and/or space
needed to perform the task. When either time or space is abundant and
cheap, it may not be worth it to pay a programmer to spend a day or so
working to make a program faster.

However, here are some cases where efficiency matters:

-   When resources are limited, a change in algorithms could create
    great savings and allow limited machines (like cell phones, embedded
    systems, and sensor networks) to be stretched to the frontier of
    possibility.

```{=html}
<!-- -->
```
-   When the data is large a more efficient solution can mean the
    difference between a task finishing in two days versus two weeks.
    Examples include physics, genetics, web searches, massive online
    stores, and network traffic analysis.

```{=html}
<!-- -->
```
-   Real time applications: the term \"real time applications\" actually
    refers to computations that give time guarantees, versus meaning
    \"fast.\" However, the quality can be increased further by choosing
    the appropriate algorithm.

```{=html}
<!-- -->
```
-   Computationally expensive jobs, like fluid dynamics, partial
    differential equations, VLSI design, and cryptanalysis can sometimes
    only be considered when the solution is found efficiently enough.

```{=html}
<!-- -->
```
-   When a subroutine is common and frequently used, time spent on a
    more efficient implementation can result in benefits for every
    application that uses the subroutine. Examples include sorting,
    searching, pseudorandom number generation, kernel operations (not to
    be confused with the operating system kernel), database queries, and
    graphics.

In short, it\'s important to save time when you do not have any time to
spare.

When is efficiency unimportant? Examples of these cases include
prototypes that are used only a few times, cases where the input is
small, when simplicity and ease of maintenance is more important, when
the area concerned is not the bottle neck, or when there\'s another
process or area in the code that would benefit far more from efficient
design and attention to the algorithm(s).

## Inventing an Algorithm

Because we assume you have some knowledge of a programming language,
let\'s start with how we translate an idea into an algorithm. Suppose
you want to write a function that will take a string as input and output
the string in lowercase:

`// `*`tolower -- translates all alphabetic, uppercase characters in str to lowercase`*\
`function `**`tolower`**`(string `*`str`*`): string`

What first comes to your mind when you think about solving this problem?
Perhaps these two considerations crossed your mind:

1.  Every character in *str* needs to be looked at
2.  A routine for converting a single character to lower case is
    required

The first point is \"obvious\" because a character that needs to be
converted might appear anywhere in the string. The second point follows
from the first because, once we consider each character, we need to do
something with it. There are many ways of writing the **tolower**
function for characters:

`function `**`tolower`**`(character `*`c`*`): character`

There are several ways to implement this function, including:

-   look *c* up in a table---a character indexed array of characters
    that holds the lowercase version of each character.

```{=html}
<!-- -->
```
-   check if *c* is in the range \'A\' ≤ *c* ≤ \'Z\', and then add a
    numerical offset to it.

These techniques depend upon the character encoding. (As an issue of
separation of concerns, perhaps the table solution is stronger because
it\'s clearer you only need to change one part of the code.)

However such a subroutine is implemented, once we have it, the
implementation of our original problem comes immediately:

`// `*`tolower -- translates all alphabetic, uppercase characters in str to lowercase`*\
`function `**`tolower`**`(string `*`str`*`): string`\
`  let `*`result`*` := ""`\
`  for-each `*`c`*` in `*`str`*`:`\
`    `*`result`*`.append(`**`tolower`**`(`*`c`*`))`\
`  repeat`\
`  return `*`result`*\
`end`

The loop is the result of our ability to translate \"every character
needs to be looked at\" into our native programming language. It became
obvious that the **tolower** subroutine call should be in the loop\'s
body. The final step required to bring the high-level task into an
implementation was deciding how to build the resulting string. Here, we
chose to start with the empty string and append characters to the end of
it.

Now suppose you want to write a function for comparing two strings that
tests if they are equal, ignoring case:

`// `*`equal-ignore-case -- returns true if s and t are equal, ignoring case`*\
`function `**`equal-ignore-case`**`(string `*`s`*`, string `*`t`*`): boolean`

These ideas might come to mind:

1.  Every character in strings *s* and *t* will have to be looked at
2.  A single loop iterating through both might accomplish this
3.  But such a loop should be careful that the strings are of equal
    length first
4.  If the strings aren\'t the same length, then they cannot be equal
    because the consideration of ignoring case doesn\'t affect how long
    the string is
5.  A tolower subroutine for characters can be used again, and only the
    lowercase versions will be compared

These ideas come from familiarity both with strings and with the looping
and conditional constructs in your language. The function you thought of
may have looked something like this:

`// `*`equal-ignore-case -- returns true if s or t are equal, ignoring case`*\
`function `**`equal-ignore-case`**`(string `*`s`*`[1..`*`n`*`], string `*`t`*`[1..`*`m`*`]): boolean`\
`  if `*`n`*` != `*`m`*`:`\
`    return false               `*`\if they aren't the same length, they aren't equal\`*\
`  fi`\
`  `\
`  for `*`i`*` := 1 to `*`n`*`:`\
`    if `**`tolower`**`(`*`s`*`[`*`i`*`]) != `**`tolower`**`(`*`t`*`[`*`i`*`]):`\
`      return false`\
`    fi`\
`  repeat`\
`  return true`\
`end`

Or, if you thought of the problem in terms of functional decomposition
instead of iterations, you might have thought of a function more like
this:

`// `*`equal-ignore-case -- returns true if s or t are equal, ignoring case`*\
`function `**`equal-ignore-case`**`(string `*`s`*`, string `*`t`*`): boolean`\
`  return `**`tolower`**`(`*`s`*`).equals(`**`tolower`**`(`*`t`*`))`\
`end`

Alternatively, you may feel neither of these solutions is efficient
enough, and you would prefer an algorithm that only ever made one pass
of *s* or *t*. The above two implementations each require two-passes:
the first version computes the lengths and then compares each character,
while the second version computes the lowercase versions of the string
and then compares the results to each other. (Note that for a pair of
strings, it is also possible to have the length precomputed to avoid the
second pass, but that can have its own drawbacks at times.) You could
imagine how similar routines can be written to test string equality that
not only ignore case, but also ignore accents.

Already you might be getting the spirit of the pseudocode in this book.
The pseudocode language is not meant to be a real programming language:
it abstracts away details that you would have to contend with in any
language. For example, the language doesn\'t assume generic types or
dynamic versus static types: the idea is that it should be clear what is
intended and it should not be too hard to convert it to your native
language. (However, in doing so, you might have to make some design
decisions that limit the implementation to one particular type or form
of data.)

There was nothing special about the techniques we used so far to solve
these simple string problems: such techniques are perhaps already in
your toolbox, and you may have found better or more elegant ways of
expressing the solutions in your programming language of choice. In this
book, we explore general algorithmic techniques to expand your toolbox
even further. Taking a naive algorithm and making it more efficient
might not come so immediately, but after understanding the material in
this book you should be able to methodically apply different solutions,
and, most importantly, you will be able to ask yourself more questions
about your programs. Asking questions can be just as important as
answering questions, because asking the right question can help you
reformulate the problem and think outside of the box.

## Understanding an Algorithm

Computer programmers need an excellent ability to reason with
multiple-layered abstractions. For example, consider the following code:

`function `**`foo`**`(integer `*`a`*`):`\
`  if (`*`a`*` / 2) * 2 == `*`a`*`:`\
`     print "The value " `*`a`*` " is even."`\
`  fi`\
`end`

To understand this example, you need to know that integer division uses
truncation and therefore when the if-condition is true then the
least-significant bit in *a* is zero (which means that *a* must be
even). Additionally, the code uses a string printing API and is itself
the definition of a function to be used by different modules. Depending
on the programming task, you may think on the layer of hardware, on down
to the level of processor branch-prediction or the cache.

Often an understanding of binary is crucial, but many modern languages
have abstractions far enough away \"from the hardware\" that these
lower-levels are not necessary. Somewhere the abstraction stops: most
programmers don\'t need to think about logic gates, nor is the physics
of electronics necessary. Nevertheless, an essential part of programming
is multiple-layer thinking.

But stepping away from computer programs toward algorithms requires
another layer: mathematics. A program may exploit properties of binary
representations. An algorithm can exploit properties of set theory or
other mathematical constructs. Just as binary itself is not explicit in
a program, the mathematical properties used in an algorithm are not
explicit.

Typically, when an algorithm is introduced, a discussion (separate from
the code) is needed to explain the mathematics used by the algorithm.
For example, to really understand a greedy algorithm (such as
Dijkstra\'s algorithm) you should understand the mathematical properties
that show how the greedy strategy is valid for all cases. In a way, you
can think of the mathematics as its own kind of subroutine that the
algorithm invokes. But this \"subroutine\" is not present in the code
because there\'s nothing to call. As you read this book try to think
about mathematics as an implicit subroutine.

## Overview of the Techniques

The techniques this book covers are highlighted in the following
overview.

-   **Divide and Conquer**: Many problems, particularly when the input
    is given in an array, can be solved by cutting the problem into
    smaller pieces (*divide*), solving the smaller parts recursively
    (*conquer*), and then combining the solutions into a single result.
    Examples include the merge sort and quicksort algorithms.

```{=html}
<!-- -->
```
-   **Randomization**: Increasingly, randomization techniques are
    important for many applications. This chapter presents some
    classical algorithms that make use of random numbers.

```{=html}
<!-- -->
```
-   **Backtracking**: Almost any problem can be cast in some form as a
    backtracking algorithm. In backtracking, you consider all possible
    choices to solve a problem and recursively solve subproblems under
    the assumption that the choice is taken. The set of recursive calls
    generates a tree in which each set of choices in the tree is
    considered consecutively. Consequently, if a solution exists, it
    will eventually be found.

Backtracking is generally an inefficient, brute-force technique, but
there are optimizations that can be performed to reduce both the depth
of the tree and the number of branches. The technique is called
backtracking because after one leaf of the tree is visited, the
algorithm will go back up the call stack (undoing choices that didn\'t
lead to success), and then proceed down some other branch. To be solved
with backtracking techniques, a problem needs to have some form of
\"self-similarity,\" that is, smaller instances of the problem (after a
choice has been made) must resemble the original problem. Usually,
problems can be generalized to become self-similar.

-   **Dynamic Programming**: Dynamic programming is an optimization
    technique for backtracking algorithms. When subproblems need to be
    solved repeatedly (i.e., when there are many duplicate branches in
    the backtracking algorithm) time can be saved by solving all of the
    subproblems first (bottom-up, from smallest to largest) and storing
    the solution to each subproblem in a table. Thus, each subproblem is
    only visited and solved once instead of repeatedly. The
    \"programming\" in this technique\'s name comes from programming in
    the sense of writing things down in a table; for example, television
    programming is making a table of what shows will be broadcast when.

```{=html}
<!-- -->
```
-   **Greedy Algorithms**: A greedy algorithm can be useful when enough
    information is known about possible choices that \"the best\" choice
    can be determined without considering all possible choices.
    Typically, greedy algorithms are not challenging to write, but they
    are difficult to prove correct.

```{=html}
<!-- -->
```
-   **Hill Climbing**: The final technique we explore is hill climbing.
    The basic idea is to start with a poor solution to a problem, and
    then repeatedly apply optimizations to that solution until it
    becomes optimal or meets some other requirement. An important case
    of hill climbing is network flow. Despite the name, network flow is
    useful for many problems that describe relationships, so it\'s not
    just for computer networks. Many matching problems can be solved
    using network flow.

------------------------------------------------------------------------

## Algorithm and code example

### Level 1 (easiest)

1\. *Find maximum* With algorithm and
several different programming languages

2\. *Find minimum*With algorithm and
several different programming languages

3\. *Find average* With algorithm and
several different programming languages

4\. *Find mode* With algorithm and several
different programming languages

5\. *Find total* With algorithm and several
different programming languages

6\. *Counting* With algorithm and several
different programming languages

7\. *Find mean* With algorithm and several different programming
languages

### Level 2

1\. *Talking to computer Lv 1*
With algorithm and several different programming languages

2\. *Sorting-bubble sort* With
algorithm and several different programming languages

### Level 3

1\. *Talking to computer Lv 2*
With algorithm and several different programming languages

### Level 4

1\. *Talking to computer Lv 3*
With algorithm and several different programming languages

2\. *Find approximate maximum*
With algorithm and several different programming languages

### Level 5

1\. *Quicksort*


# Algorithms/Mathematical Background

Before we begin learning algorithmic techniques, we take a detour to
give ourselves some necessary mathematical tools. First, we cover
mathematical definitions of terms that are used later on in the book. By
expanding your mathematical vocabulary you can be more precise and you
can state or formulate problems more simply. Following that, we cover
techniques for analysing the running time of an algorithm. After each
major algorithm covered in this book we give an analysis of its running
time as well as a proof of its correctness

## Asymptotic Notation

In addition to correctness another important characteristic of a useful
algorithm is its time and memory consumption. Time and memory are both
valuable resources and there are important differences (even when both
are abundant) in how we can use them.

How can you measure resource consumption? One way is to create a
function that describes the usage in terms of some characteristic of the
input. One commonly used characteristic of an input dataset is its size.
For example, suppose an algorithm takes an input as an array of $n$
integers. We can describe the time this algorithm takes as a function
$f$ written in terms of $n$. For example, we might write:

$$f(n) = n^2 + 3n + 14$$

where the value of $f(n)$ is some unit of time (in this discussion the
main focus will be on time, but we could do the same for memory
consumption). Rarely are the units of time actually in seconds, because
that would depend on the machine itself, the system it\'s running, and
its load. Instead, the units of time typically used are in terms of the
number of some fundamental operation performed. For example, some
fundamental operations we might care about are: the number of additions
or multiplications needed; the number of element comparisons; the number
of memory-location swaps performed; or the raw number of machine
instructions executed. In general we might just refer to these
fundamental operations performed as steps taken.

Is this a good approach to determine an algorithm\'s resource
consumption? Yes and no. When two different algorithms are similar in
time consumption a precise function might help to determine which
algorithm is faster under given conditions. But in many cases it is
either difficult or impossible to calculate an analytical description of
the exact number of operations needed, especially when the algorithm
performs operations conditionally on the values of its input. Instead,
what really is important is not the precise time required to complete
the function, but rather the degree that resource consumption changes
depending on its inputs. Concretely, consider these two functions,
representing the computation time required for each size of input
dataset:

$$f(n) = n^3-12n^2+20n+110$$

$$g(n) = n^3+n^2+5n+5$$

They look quite different, but how do they behave? Let\'s look at a few
plots of the function ($f(n)$ is in red, $g(n)$ in blue):

+----------------------------------+----------------------------------+
| !Plot of f and g, in range 0 to | ![Plot of f and g, in range 0 to |
| 5 | t of f and g, in range 0 to 15") |
+----------------------------------+----------------------------------+
| !Plot of f and g, in range 0 to | ![Plot of f and g, in range 0 to |
| 100 | f f and g, in range 0 to 1000")\ |
+----------------------------------+----------------------------------+

In the first, very-limited plot the curves appear somewhat different. In
the second plot they start going in sort of the same way, in the third
there is only a very small difference, and at last they are virtually
identical. In fact, they approach $n^3$, the dominant term. As n gets
larger, the other terms become much less significant in comparison to
n^3^.

As you can see, modifying a polynomial-time algorithm\'s low-order
coefficients doesn\'t help much. What really matters is the
highest-order coefficient. This is why we\'ve adopted a notation for
this kind of analysis. We say that:

$$f(n) = n^3-12n^2+20n+110 = O(n^3)$$

We ignore the low-order terms. We can say that:

$$O(\log {n}) \le O(\sqrt{n}) \le O(n) \le O(n \log {n}) \le O(n^2) \le O(n^3) \le O(2^n)$$

This gives us a way to more easily compare algorithms with each other.
Running an insertion sort on $n$ elements takes steps on the order of
$O(n^2)$. Merge sort sorts in $O(n \log {n})$ steps. Therefore, once the
input dataset is large enough, merge sort is faster than insertion sort.

In general, we write

$$f(n) = O(g(n))$$

when

$$\exists c>0, \exists n_0> 0, \forall n\ge n_{0}: 0\le f(n)\le c\cdot g(n).$$

That is, $f(n) = O(g(n))$ holds if and only if there exists some
constants $c$ and $n_0$ such that for all $n>n_0$ $f(n)$ is positive and
less than or equal to $c g(n)$.

Note that the equal sign used in this notation describes a relationship
between $f(n)$ and $g(n)$ instead of reflecting a true equality. In
light of this, some define Big-O in terms of a set, stating that:

$$f(n)\in O(g(n))$$

when

$$f(n)\in \{f(n) : \exists c>0, \exists n_0> 0, \forall n\ge n_0: 0\le f(n)\le c\cdot g(n)\}.$$

Big-O notation is only an upper bound; these two are both true:

$$n^3 = O(n^4)$$

$$n^4 = O(n^4)$$

If we use the equal sign as an equality we can get very strange results,
such as:

$$n^3 = n^4$$

which is obviously nonsense. This is why the set-definition is handy.
You can avoid these things by thinking of the equal sign as a one-way
equality, i.e.:

$$n^3 = O(n^4)$$

does not imply

$$O(n^4) = n^3$$

Always keep the O on the right hand side.

### Big Omega

Sometimes, we want more than an upper bound on the behavior of a certain
function. Big Omega provides a lower bound. In general, we say that

$$f(n) = \Omega(g(n))$$

when

$$\exists c>0, \exists n_0> 0, \forall n\ge n_{0}: 0\le c\cdot g(n)\le f(n).$$

i.e. $f(n) = \Omega(g(n))$ if and only if there exist constants c and
n~0~ such that for all n\>n~0~ f(n) is positive and **greater** than or
equal to cg(n).

So, for example, we can say that

$$n^2-2n = \Omega(n^2)$$, (c=1/2, n~0~=4) or

$$n^2-2n = \Omega(n)$$, (c=1, n~0~=3),

but it is false to claim that

$$n^2-2n = \Omega(n^3).$$

### Big Theta

When a given function is both O(g(n)) and Ω(g(n)), we say it is Θ(g(n)),
and we have a tight bound on the function. A function f(n) is Θ(g(n))
when

$$\exists c_1>0, \exists c_2>0, \exists n_0> 0, \forall n\ge n_0 : 0\le c_1\cdot g(n)\le f(n)\le c_2\cdot g(n),$$

but most of the time, when we\'re trying to prove that a given
$f(n) = \Theta(g(n))$, instead of using this definition, we just show
that it is both O(g(n)) and Ω(g(n)).

### Little-O and Omega

When the asymptotic bound is not tight, we can express this by saying
that $f(n) = o(g(n))$ or $f(n) = \omega(g(n)).$ The definitions are:

:   f(n) is o(g(n)) iff
    $\forall c>0, \exists n_0> 0, \forall n\ge n_0: 0\le f(n) < c\cdot g(n)$
    and
:   f(n) is ω(g(n)) iff
    $\forall c>0, \exists n_0> 0, \forall n\ge n_0: 0\le c\cdot g(n) < f(n).$

Note that a function f is in o(g(n)) when for any coefficient of g, g
eventually gets larger than f, while for O(g(n)), there only has to
exist a single coefficient for which g eventually gets at least as big
as f.

### Big-O with multiple variables

Given a functions with two parameters $f(n,m)$ and $g(n,m)$,

$f(n,m)=O(g(n,m))$ if and only if
$\exists c > 0, \exists n_0 > 0, \exists m_0 > 0, \forall n \geq n_0, \forall m \geq m_0 : 0 \leq f(n,m) \leq c \cdot g(n,m)$.

For example, $5n + 3m = O(n+m)$, and $n + 10m + 3nm = O(nm)$.

## Algorithm Analysis: Solving Recurrence Equations

Merge sort of n elements: $T(n) = 2*T(n/2) + c(n)$ This describes one
iteration of the merge sort: the problem space $n$ is reduced to two
halves ($2*T(n/2)$), and then merged back together at the end of all the
recursive calls ($c(n)$). This notation system is the bread and butter
of algorithm analysis, so get used to it.

There are some theorems you can use to estimate the big Oh time for a
function if its recurrence equation fits a certain pattern.

### Substitution method

Formulate a guess about the big Oh time of your equation. Then use proof
by induction to prove the guess is correct.

### Summations

### Draw the Tree and Table

This is really just a way of getting an intelligent guess. You still
have to go back to the substitution method in order to prove the big Oh
time.

### The Master Theorem

Consider a recurrence equation that fits the following formula:

$$T(n) = a T\left({\frac{n}{b}}\right) + O(n^k)$$

for *a* ≥ 1, *b* \> 1 and *k* ≥ 0. Here, *a* is the number of recursive
calls made per call to the function, *n* is the input size, *b* is how
much smaller the input gets, and *k* is the polynomial order of an
operation that occurs each time the function is called (except for the
base cases). For example, in the merge sort algorithm covered later, we
have

$$T(n) = 2 T\left({\frac{n}{2}}\right) + O(n)$$

because two subproblems are called for each non-base case iteration, and
the size of the array is divided in half each time. The $O(n)$ at the
end is the \"conquer\" part of this divide and conquer algorithm: it
takes linear time to merge the results from the two recursive calls into
the final result.

Thinking of the recursive calls of *T* as forming a tree, there are
three possible cases to determine where most of the algorithm is
spending its time (\"most\" in this sense is concerned with its
asymptotic behaviour):

1.  the tree can be **top heavy**, and most time is spent during the
    initial calls near the root;
2.  the tree can have a **steady state**, where time is spread evenly;
    or
3.  the tree can be **bottom heavy**, and most time is spent in the
    calls near the leaves

Depending upon which of these three states the tree is in *T* will have
different complexities:

```{=html}
<div style="background-color: #FFFFEE; border: solid 1px #FFC92E; padding: 1em; width: 80%;" valign=top>
```
**The Master Theorem**\
Given $T(n) = a T\left({\frac{n}{b}}\right) + O(n^k)$ for *a* ≥ 1, *b*
\> 1 and *k* ≥ 0:

-   If $a < b^k$, then $T(n) = O(n^k)\$ (top heavy)
-   If $a = b^k$, then $T(n) = O(n^k\cdot \log n)$ (steady state)
-   If $a > b^k$, then $T(n) = O(n^{\log_b a})$ (bottom heavy)

```{=html}
</div>
```
For the merge sort example above, where

$$T(n) = 2 T\left({\frac{n}{2}}\right) + O(n)$$

we have

$$a=2, b=2, k=1\implies b^k = 2$$

thus, $a = b^k$ and so this is also in the \"steady state\": By the
master theorem, the complexity of merge sort is thus

$$T(n) = O(n^1\log n) = O(n \log n)$$.

## Amortized Analysis

\[Start with an adjacency list representation of a graph and show two
nested for loops: one for each node n, and nested inside that one loop
for each edge e. If there are n nodes and m edges, this could lead you
to say the loop takes O(nm) time. However, only once could the innerloop
take that long, and a tighter bound is O(n+m).\]

------------------------------------------------------------------------