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.

Part II.Types and Operations4. Introducing <strong>Python</strong> Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65Why Use Built-in Types? 66<strong>Python</strong>’s Core Data Types 67Numbers 68Strings 69Sequence Operations 70Immutability 71Type-Specific Methods 72Getting Help 73Other Ways to Code Strings 74Pattern Matching 75Lists 75Sequence Operations 76Type-Specific Operations 76Bounds Checking 77Nesting 77List Comprehensions 78Dictionaries 79Mapping Operations 79Nesting Revisited 80Sorting Keys: for Loops 81Iteration and Optimization 83Missing Keys: if Tests 84Tuples 85Why Tuples? 85Files 85Other File-Like Tools 86Other Core Types 87How to Break Your Code’s Flexibility 88User-Defined Classes 88And Everything Else 89Chapter Summary 90Brain Builder 91Chapter Quiz 91Quiz Answers 91x | Table of Contents

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

Saved successfully!

Ooh no, something went wrong!