12.07.2015 Views

Think Python - Denison University

Think Python - Denison University

Think Python - Denison University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Index 211poker, 169, 178polygon function, 31polymorphism, 166, 167, 176pop method, 94, 173popen function, 140portability, 1, 7postcondition, 36, 59, 177pprint module, 112precedence, 16, 201precondition, 36, 59, 100, 177prefix, 131prettyprint, 112print statement, 6, 8, 163, 199problem recognition, 84–86problem solving, 1, 7profile module, 132program, 2, 7program testing, 85programming language, 1Project Gutenberg, 125prompt, 2, 7, 45prose, 5prototype and patch, 154, 156, 158pseudorandom, 126, 133pure function, 154, 158Puzzler, 86, 113, 124Pythagorean theorem, 52<strong>Python</strong> 3.0, 6, 12, 45, 111, 118<strong>Python</strong> debugger (pdb), 199<strong>Python</strong> Imaging Library (PIL),192python.org, 8quotation mark, 6, 9, 35, 74, 196radd method, 165radian, 18rage, 201raisestatement, 107, 157Ramanujan, Srinivasa, 69randint function, 100, 126random function, 121, 126random module, 100, 121, 126, 174random number, 126random text, 131random walk programming, 133, 201rank, 169raw input function, 45read method, 141readline method, 81, 141Rectangle class, 147recursion, 42, 43, 47, 55, 57base case, 44infinite, 44, 58, 198recursive definition, 56, 124reduce pattern, 93, 100reducible word, 114, 124redundancy, 5refactoring, 34, 36reference, 97, 100aliasing, 96relational operator, 40, 171relative path, 137, 143reload function, 142, 196remove method, 94repetition, 30list,91replace method, 125repr function, 142representation, 145, 147, 169return statement, 43, 51, 201return value, 17, 26, 51, 148tuple, 117reverse lookup, dictionary, 106, 113reverse wordpair, 101reversed function, 122rotationletters,113rotation, letter,80RSA algorithm, 112rules of precedence, 13, 16running pace, 8, 16, 158runtime error,3, 15, 44, 46, 195, 198RuntimeError, 44, 58safelanguage, 3sanity check, 112scaffolding, 53, 60, 112scatter, 117, 123Scrabble, 124script, 2, 7script mode, 2, 7, 12, 24search, 107search pattern, 75, 79, 83search, binary, 101search, bisection, 101secret exercise, 143self (parameter name), 161semantic error,4, 8, 10, 15, 78, 195, 199semantics, 4, 8, 159sequence, 71, 79, 89, 95, 115, 121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!