12.07.2015 Views

Is Python a

Is Python a

Is Python a

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Files in Action 178Storing and parsing <strong>Python</strong> objects in files 178Storing native <strong>Python</strong> objects with pickle 180Storing and parsing packed binary data in files 181Other File Tools 182Type Categories Revisited 182Object Flexibility 183References Versus Copies 184Comparisons, Equality, and Truth 186The Meaning of True and False in <strong>Python</strong> 188<strong>Python</strong>’s Type Hierarchies 189Other Types in <strong>Python</strong> 191Built-in Type Gotchas 191Assignment Creates References, Not Copies 191Repetition Adds One Level Deep 192Beware of Cyclic Data Structures 193Immutable Types Can’t Be Changed In-Place 193Chapter Summary 193Brain Builder 195Chapter Quiz 195Quiz Answers 195Brain Builder: Part II Exercises 196Part III.Statements and Syntax10. Introducing <strong>Python</strong> Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201<strong>Python</strong> Program Structure Revisited 201<strong>Python</strong>’s Statements 202A Tale of Two ifs 203What <strong>Python</strong> Adds 204What <strong>Python</strong> Removes 204Parentheses are optional 204End of line is end of statement 204End of indentation is end of block 205Why Indentation Syntax? 206A Few Special Cases 208xiv | Table of Contents

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

Saved successfully!

Ooh no, something went wrong!