Think Python
O'Reilly Media (Verlag)
978-1-4919-3936-9 (ISBN)
Through exercises in each chapter, you’ll try out programming concepts as you learn them. Think Python is ideal for students at the high school or college level, as well as self-learners, home-schooled students, and professionals who need to learn programming basics. Beginners just getting their feet wet will learn how to start with Python in a browser.
- Start with the basics, including language syntax and semantics
- Get a clear definition of each programming concept
- Learn about values, variables, statements, functions, and data structures in a logical progression
- Discover how to work with files and databases
- Understand objects, methods, and object-oriented programming
- Use debugging techniques to fix syntax, runtime, and semantic errors
- Explore interface design, data structures, and GUI-based programs through case studies
Allen Downey is a Professor of Computer Science at Olin College of Engineering. He has taught at Wellesley College, Colby College and U.C. Berkeley. He has a Ph.D. in Computer Science from U.C. Berkeley and Master's and Bachelor's degrees from MIT.
Chapter 1The Way of the Program
What Is a Program?
Running Python
The First Program
Arithmetic Operators
Values and Types
Formal and Natural Languages
Debugging
Glossary
Exercises
Chapter 2Variables, Expressions and Statements
Assignment Statements
Variable Names
Expressions and Statements
Script Mode
Order of Operations
String Operations
Comments
Debugging
Glossary
Exercises
Chapter 3Functions
Function Calls
Math Functions
Composition
Adding New Functions
Definitions and Uses
Flow of Execution
Parameters and Arguments
Variables and Parameters Are Local
Stack Diagrams
Fruitful Functions and Void Functions
Why Functions?
Debugging
Glossary
Exercises
Chapter 4Case Study: Interface Design
The turtle Module
Simple Repetition
Exercises
Encapsulation
Generalization
Interface Design
Refactoring
A Development Plan
docstring
Debugging
Glossary
Exercises
Chapter 5Conditionals and Recursion
Floor Division and Modulus
Boolean Expressions
Logical Operators
Conditional Execution
Alternative Execution
Chained Conditionals
Nested Conditionals
Recursion
Stack Diagrams for Recursive Functions
Infinite Recursion
Keyboard Input
Debugging
Glossary
Exercises
Chapter 6Fruitful Functions
Return Values
Incremental Development
Composition
Boolean Functions
More Recursion
Leap of Faith
One More Example
Checking Types
Debugging
Glossary
Exercises
Chapter 7Iteration
Reassignment
Updating Variables
The while Statement
break
Square Roots
Algorithms
Debugging
Glossary
Exercises
Chapter 8Strings
A String Is a Sequence
len
Traversal with a for Loop
String Slices
Strings Are Immutable
Searching
Looping and Counting
String Methods
The in Operator
String Comparison
Debugging
Glossary
Exercises
Chapter 9Case Study: Word Play
Reading Word Lists
Exercises
Search
Looping with Indices
Debugging
Glossary
Exercises
Chapter 10Lists
A List Is a Sequence
Lists Are Mutable
Traversing a List
List Operations
List Slices
List Methods
Map, Filter and Reduce
Deleting Elements
Lists and Strings
Objects and Values
Aliasing
List Arguments
Debugging
Glossary
Exercises
Chapter 11Dictionaries
A Dictionary Is a Mapping
Dictionary as a Collection of Counters
Looping and Dictionaries
Reverse Lookup
Dictionaries and Lists
Memos
Global Variables
Debugging
Glossary
Exercises
Chapter 12Tuples
Tuples Are Immutable
Tuple Assignment
Tuples as Return Values
Variable-Length Argument Tuples
Lists and Tuples
Dictionaries and Tuples
Sequences of Sequences
Debugging
Glossary
Exercises
Chapter 13Case Study: Data Structure Selection
Word Frequency Analysis
Random Numbers
Word Histogram
Most Common Words
Optional Parameters
Dictionary Subtraction
Random Words
Markov Analysis
Data Structures
Debugging
Glossary
Exercises
Chapter 14Files
Persistence
Reading and Writing
Format Operator
Filenames and Paths
Catching Exceptions
Databases
Pickling
Pipes
Writing Modules
Debugging
Glossary
Exercises
Chapter 15Classes and Objects
Programmer-Defined Types
Attributes
Rectangles
Instances as Return Values
Objects Are Mutable
Copying
Debugging
Glossary
Exercises
Chapter 16Classes and Functions
Time
Pure Functions
Modifiers
Prototyping versus Planning
Debugging
Glossary
Exercises
Chapter 17Classes and Methods
Object-Oriented Features
Printing Objects
Another Example
A More Complicated Example
The init Method
The __str__ Method
Operator Overloading
Type-Based Dispatch
Polymorphism
Interface and Implementation
Debugging
Glossary
Exercises
Chapter 18Inheritance
Card Objects
Class Attributes
Comparing Cards
Decks
Printing the Deck
Add, Remove, Shuffle and Sort
Inheritance
Class Diagrams
Data Encapsulation
Debugging
Glossary
Exercises
Chapter 19The Goodies
Conditional Expressions
List Comprehensions
Generator Expressions
any and all
Sets
Counters
defaultdict
Named Tuples
Gathering Keyword Args
Glossary
Exercises
Chapter 20Debugging
Syntax Errors
Runtime Errors
Semantic Errors
Chapter 21Analysis of Algorithms
Order of Growth
Analysis of Basic Python Operations
Analysis of Search Algorithms
Hashtables
Glossary
Erscheinungsdatum | 31.12.2015 |
---|---|
Zusatzinfo | black & white illustrations |
Verlagsort | Sebastopol |
Sprache | englisch |
Maße | 177 x 232 mm |
Gewicht | 502 g |
Einbandart | kartoniert |
Themenwelt | Informatik ► Programmiersprachen / -werkzeuge ► Python |
Mathematik / Informatik ► Informatik ► Web / Internet | |
Schlagworte | Programmieren • Programmieren lernen • Python |
ISBN-10 | 1-4919-3936-2 / 1491939362 |
ISBN-13 | 978-1-4919-3936-9 / 9781491939369 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich