\contentsline {chapter}{\numberline {1}Whetting Your Appetite}{1}
\contentsline {section}{\numberline {1.1}Where From Here}{2}
\contentsline {chapter}{\numberline {2}Using the Python Interpreter}{3}
\contentsline {section}{\numberline {2.1}Invoking the Interpreter}{3}
\contentsline {subsection}{\numberline {2.1.1}Argument Passing}{4}
\contentsline {subsection}{\numberline {2.1.2}Interactive Mode}{4}
\contentsline {section}{\numberline {2.2}The Interpreter and its Environment}{4}
\contentsline {subsection}{\numberline {2.2.1}Error Handling}{4}
\contentsline {subsection}{\numberline {2.2.2}The Module Search Path}{5}
\contentsline {subsection}{\numberline {2.2.3}``Compiled'' Python files}{5}
\contentsline {subsection}{\numberline {2.2.4}Executable Python scripts}{5}
\contentsline {subsection}{\numberline {2.2.5}The Interactive Startup File}{6}
\contentsline {section}{\numberline {2.3}Interactive Input Editing and History Substitution}{6}
\contentsline {subsection}{\numberline {2.3.1}Line Editing}{6}
\contentsline {subsection}{\numberline {2.3.2}History Substitution}{7}
\contentsline {subsection}{\numberline {2.3.3}Key Bindings}{7}
\contentsline {subsection}{\numberline {2.3.4}Commentary}{8}
\contentsline {chapter}{\numberline {3}An Informal Introduction to Python}{9}
\contentsline {section}{\numberline {3.1}Using Python as a Calculator}{9}
\contentsline {subsection}{\numberline {3.1.1}Numbers}{9}
\contentsline {subsection}{\numberline {3.1.2}Strings}{11}
\contentsline {subsection}{\numberline {3.1.3}Lists}{14}
\contentsline {section}{\numberline {3.2}First Steps Towards Programming}{16}
\contentsline {chapter}{\numberline {4}More Control Flow Tools}{18}
\contentsline {section}{\numberline {4.1}If Statements}{18}
\contentsline {section}{\numberline {4.2}For Statements}{18}
\contentsline {section}{\numberline {4.3}The {\ptt range()} Function}{19}
\contentsline {section}{\numberline {4.4}Break and Continue Statements, and Else Clauses on Loops}{20}
\contentsline {section}{\numberline {4.5}Pass Statements}{21}
\contentsline {section}{\numberline {4.6}Defining Functions}{21}
\contentsline {chapter}{\numberline {5}Odds and Ends}{24}
\contentsline {section}{\numberline {5.1}More on Lists}{24}
\contentsline {section}{\numberline {5.2}The {\ptt del} statement}{25}
\contentsline {section}{\numberline {5.3}Tuples and Sequences}{26}
\contentsline {section}{\numberline {5.4}Dictionaries}{27}
\contentsline {section}{\numberline {5.5}More on Conditions}{28}
\contentsline {section}{\numberline {5.6}Comparing Sequences and Other Types}{29}
\contentsline {chapter}{\numberline {6}Modules}{31}
\contentsline {section}{\numberline {6.1}More on Modules}{33}
\contentsline {section}{\numberline {6.2}Standard Modules}{33}
\contentsline {section}{\numberline {6.3}The {\ptt dir()} function}{34}
\contentsline {chapter}{\numberline {7}Output Formatting}{36}
\contentsline {chapter}{\numberline {8}Errors and Exceptions}{40}
\contentsline {section}{\numberline {8.1}Syntax Errors}{40}
\contentsline {section}{\numberline {8.2}Exceptions}{40}
\contentsline {section}{\numberline {8.3}Handling Exceptions}{41}
\contentsline {section}{\numberline {8.4}Raising Exceptions}{43}
\contentsline {section}{\numberline {8.5}User-defined Exceptions}{44}
\contentsline {section}{\numberline {8.6}Defining Clean-up Actions}{44}
\contentsline {chapter}{\numberline {9}Classes}{46}
\contentsline {section}{\numberline {9.1}A word about terminology}{46}
\contentsline {section}{\numberline {9.2}Python scopes and name spaces}{47}
\contentsline {section}{\numberline {9.3}A first look at classes}{49}
\contentsline {subsection}{\numberline {9.3.1}Class definition syntax}{49}
\contentsline {subsection}{\numberline {9.3.2}Class objects}{49}
\contentsline {subsection}{\numberline {9.3.3}Instance objects}{50}
\contentsline {subsection}{\numberline {9.3.4}Method objects}{51}
\contentsline {section}{\numberline {9.4}Random remarks}{51}
\contentsline {section}{\numberline {9.5}Inheritance}{54}
\contentsline {subsection}{\numberline {9.5.1}Multiple inheritance}{54}
\contentsline {section}{\numberline {9.6}Odds and ends}{55}
\contentsline {chapter}{\numberline {10}Recent Additions}{57}
\contentsline {section}{\numberline {10.1}The Last Printed Expression}{57}
\contentsline {section}{\numberline {10.2}String Literals}{58}
\contentsline {subsection}{\numberline {10.2.1}Double Quotes}{58}
\contentsline {subsection}{\numberline {10.2.2}Continuation Of String Literals}{58}
\contentsline {subsection}{\numberline {10.2.3}Triple-quoted strings}{58}
\contentsline {subsection}{\numberline {10.2.4}String Literal Juxtaposition}{59}
\contentsline {section}{\numberline {10.3}The Formatting Operator}{59}
\contentsline {subsection}{\numberline {10.3.1}Basic Usage}{59}
\contentsline {subsection}{\numberline {10.3.2}Referencing Variables By Name}{60}
\contentsline {section}{\numberline {10.4}Optional Function Arguments}{60}
\contentsline {subsection}{\numberline {10.4.1}Default Argument Values}{60}
\contentsline {subsection}{\numberline {10.4.2}Arbitrary Argument Lists}{61}
\contentsline {section}{\numberline {10.5}Lambda And Functional Programming Tools}{61}
\contentsline {subsection}{\numberline {10.5.1}Lambda Forms}{61}
\contentsline {subsection}{\numberline {10.5.2}Map, Reduce and Filter}{61}
\contentsline {subsubsection}{Map.}{62}
\contentsline {subsubsection}{Filter.}{62}
\contentsline {subsubsection}{Reduce.}{62}
\contentsline {section}{\numberline {10.6}Continuation Lines Without Backslashes}{63}
\contentsline {section}{\numberline {10.7}Regular Expressions}{63}
\contentsline {section}{\numberline {10.8}Generalized Dictionaries}{64}
\contentsline {section}{\numberline {10.9}Miscellaneous New Built-in Functions}{64}
\contentsline {section}{\numberline {10.10}Else Clause For Try Statement}{65}
\contentsline {section}{\numberline {10.11}New Class Features in Release 1.1}{65}
\contentsline {subsection}{\numberline {10.11.1}New Operator Overloading}{65}
\contentsline {subsection}{\numberline {10.11.2}Trapping Attribute Access}{66}
\contentsline {subsection}{\numberline {10.11.3}Calling a Class Instance}{67}
