
Nguồn ngoài
Think Python - How to Think Like a Computer Scientist (Downey)
Think Python is a concise introduction to software design using the Python programming language. Intended for people with no programming experience, this book starts with the most basic concepts and gradually adds new material. Some of the ideas students find most challenging, like recursion and object-oriented programming, are divided into a sequence of smaller steps and introduced over the course of several chapters.
- Tác giả
- Allen B. Downey
- Nhà xuất bản
- Olin College
- Nguồn
- LibreTexts
- Giấy phép
- CC BY-NC-SA
- Ngôn ngữ
- EN
- Danh mục
- Công nghệ thông tin
Mục lục· 249 mục
- 01: Lists
- 1.01: A List Is a Sequence
- 1.02: Lists Are Mutable
- 1.03: Traversing a List
- 1.04: List Operations
- 1.05: List Slices
- 1.06: List Methods
- 1.07: Map Filter and Reduce
- 1.08: Deleting Elements
- 1.09: Lists and Strings
- 1.10: Objects and Values
- 1.11: Aliasing
- 1.12: List Arguments
- 1.13: Debugging
- 1.14: Glossary
- 1.15: Exercises
- 02: Dictionaries
- 2.01: Introduction
- 2.02: Dictionary as a Set of Counters
- 2.03: Looping and Dictionaries
- 2.04: Reverse Lookup
- 2.05: Dictionaries and Lists
- 2.06: Memos
- 2.07: Global Variables
- 2.08: Long Integers
- 2.09: Debugging
- 2.10: Glossary
- 2.11: Exercises
- 03: Tuples
- 3.01: Tuples Are Immutable
- 3.02: Tuple Assignment
- 3.03: Tuples as Return Values
- 3.04: Variable-Length Argument Tuples
- 3.05: Lists and Tuples
- 3.06: Dictionaries and Tuples
- 3.07: Comparing Tuples
- 3.08: Sequences of Sequences
- 3.09: Debugging
- 3.10: Glossary
- 3.11: Exercises
- 04: Case Study- Data Structure Selection
- 4.01: Word Frequency Analysis
- 4.02: Random Numbers
- 4.03: Word Histogram
- 4.04: Most Common Words
- 4.05: Optional Parameters
- 4.06: Dictionary Subtraction
- 4.07: Random Words
- 4.08: Markov Analysis
- 4.09: Data Structures
- 4.10: Debugging
- 4.11: Glossary
- 4.12: Exercises
- 05: Files
- 5.01: Persistence
- 5.02: Reading and Writing
- 5.03: Format Operator
- 5.04: Filenames and Paths
- 5.05: Catching Exceptions
- 5.06: Databases
- 5.07: Pickling
- 5.08: Pipes
- 5.09: Writing Modules
- 5.10: Debugging
- 5.11: Glossary
- 5.12: Exercises
- 06: Classes and Objects
- 6.01: User-Defined Types
- 6.02: Attributes
- 6.03: Rectangles
- 6.04: Instances as Return Values
- 6.05: Objects Are Mutable
- 6.06: Copying
- 6.07: Debugging
- 6.08: Glossary
- 6.09: Exercises
- 07: Classes and Functions
- 7.01: Time
- 7.02: Pure Functions
- 7.03: Modifiers
- 7.04: Prototyping versus Planning
- 7.05: Debugging
- 7.06: Glossary
- 7.07: Exercises
- 08: Classes and Methods
- 8.01: Object-Oriented Features
- 8.02: Printing Objects
- 8.03: Another Example
- 8.04: A More Complicated Example
- 8.05: The Init Method
- 8.06: The str Method
- 8.07: Operator Overloading
- 8.08: Type-Based Dispatch
- 8.09: Polymorphism
- 8.10: Debugging
- 8.11: Interface and Implementation
- 8.12: Glossary
- 8.13: Exercises
- 09: Inheritance
- 9.01: Card Objects
- 9.02: Class Attributes
- 9.03: Comparing Cards
- 9.04: Decks
- 9.05: Printing the Deck
- 9.06: Add, Remove, Shuffle and Sort
- 9.07: Inheritance
- 9.08: Class Diagrams
- 9.09: Debugging
- 9.10: Data Encapsulation
- 9.11: Glossary
- 9.12: Exercises
- 10: Case Study- Tkinter
- 10.01: GUI
- 10.02: Buttons and Callbacks
- 10.03: Canvas Widgets
- 10.04: Coordinate Sequences
- 10.05: More Widgets
- 10.06: Packing Widgets
- 10.07: Menus and Callables
- 10.08: Binding
- 10.09: Debugging
- 10.10: Glossary
- 10.11: Exercises
- 11: The Way of The Program
- 11.01: The Python Programming Language
- 11.02: What Is a Program
- 11.03: What Is Debugging
- 11.04: Formal and Natural Languages
- 11.05: The First Program
- 11.06: Debugging
- 11.07: Glossary
- 11.08: Exercises
- 12: Appendix A- Debugging
- 12.01: Syntax Errors
- 12.02: Runtime Errors
- 12.03: Semantic Errors
- 13: Appendix B- Analysis of Algorithms
- 13.01: Order of Growth
- 13.02: Analysis of Basic Python Operations
- 13.03: Analysis of Search Algorithms
- 13.04: Hashtables
- 14: Appendix C- Lumpy
- 14.01: State Diagram
- 14.02: Stack Diagram
- 14.03: Object Diagrams
- 14.04: Function and Class Objects
- 14.05: Class Diagrams
- 15: Variables Expressions and Statements
- 15.01: Values and Types
- 15.02: Variables
- 15.03: Variable Names and Keywords
- 15.04: Operators and Operands
- 15.05: Expressions and Statements
- 15.06: Interactive Mode and Script Mode
- 15.07: Order of Operations
- 15.08: String Operations
- 15.09: Comments
- 15.10: Debugging
- 15.11: Glossary
- 15.12: Exercises
- 16: Functions
- 16.01: Function Calls
- 16.02: Type Conversion Functions
- 16.03: Math Functions
- 16.04: Composition
- 16.05: Adding New Functions
- 16.06: Definitions and Uses
- 16.07: Flow of Execution
- 16.08: Parameters and Arguments
- 16.09: Variables and Parameters Are Local
- 16.10: Stack Diagrams
- 16.11: Fruitful Functions and Void Functions
- 16.12: Why Functions?
- 16.13: Importing with from
- 16.14: Debugging
- 16.15: Glossary
- 16.16: Exercises
- 17: Case Study- Interface Design
- 17.01: TurtleWorld
- 17.02: Simple Repetition
- 17.03: Exercises
- 17.04: Encapsulation
- 17.05: Generalization
- 17.06: Interface Design
- 17.07: Refactoring
- 17.08: A Development Plan
- 17.09: docstring
- 17.10: Debugging
- 17.11: Glossary
- 17.12: Exercises
- 18: Conditionals and Recursion
- 18.01: Modulus Operator
- 18.02: Boolean Expressions
- 18.03: Logical Operators
- 18.04: Conditional Execution
- 18.05: Alternative Execution
- 18.06: Chained Conditionals
- 18.07: Nested Conditionals
- 18.08: Recursion
- 18.09: Stack Diagrams for Recursive Functions
- 18.10: Infinite Recursion
- 18.11: Keyboard Input
- 18.12: Debugging
- 18.13: Glossary
- 18.14: Exercises
- 19: Fruitful Functions
- 19.01: Return Values
- 19.02: Incremental Development
- 19.03: Composition
- 19.04: Boolean Functions
- 19.05: More Recursion
- 19.06: Leap of Faith
- 19.07: One More Example
- 19.08: Checking Types
- 19.09: Debugging
- 19.10: Glossary
- 19.11: Exercises
- 20: Iteration
- 20.01: Multiple Assignment
- 20.02: Updating Variables
- 20.03: The while Statement
- 20.04: break
- 20.05: Square Roots
- 20.06: Algorithms
- 20.07: Debugging
- 20.08: Glossary
- 20.09: Exercises
- 21: Strings
- 21.01: A String Is a Sequence
- 21.02: len
- 21.03: Traversal with a for Loop
- 21.04: String Slices
- 21.05: Strings Are Immutable
- 21.06: Searching
- 21.07: Looping and Counting
- 21.08: String Methods
- 21.09: The in Operator
- 21.10: String Comparison
- 21.11: Debugging
- 21.12: Glossary
- 21.13: Exercises
- 22: Case Study- Word Play
- 22.01: Reading Word Lists
- 22.02: Exercises
- 22.03: Search
- 22.04: Looping with Indices
- 22.05: Debugging
- 22.06: Glossary
- 22.07: Exercises