ThinkPython_HowtoThinkLikeaComputerScien.epub - (EPUB全文下载)
文件大小:0.56 mb。
文件格式:epub 格式。
书籍内容:
Buy this book at Amazon.com
Think Python: How to Think Like a Computer Scientist
Allen B. Downey
2nd Edition, Version 2.2.18
Preface
The strange history of this book
Acknowledgments
Contributor List
The 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
Variables, expressions and statements
Assignment statements
Variable names
Expressions and statements
Script mode
Order of operations
String operations
Comments
Debugging
Glossary
Exercises
Functions
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
Case study: interface design
The turtle module
Simple repetition
Exercises
Encapsulation
Generalization
Interface design
Refactoring
A development plan
docstring
Debugging
Glossary
Exercises
Conditionals 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
Fruitful functions
Return values
Incremental development
Composition
Boolean functions
More recursion
Leap of faith
One more example
Checking types
Debugging
Glossary
Exercises
Iteration
Reassignment
Updating variables
The while
statement
break
Square roots
Algorithms
Debugging
Glossary
Exercises
Strings
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
Case study: word play
Reading word lists
Exercises
Search
Looping with indices
Debugging
Glossary
Exercises
Lists
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
Dictionaries
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
Tuples
Tuples are immutable
Tuple assignment
Tuples as return values
Variable-length argument tuples
Lists and tuples
Dictionaries and tuples
Seq ............
书籍插图:
以上为书籍内容预览,如需阅读全文内容请下载EPUB源文件,祝您阅读愉快。
书云 Open E-Library » ThinkPython_HowtoThinkLikeaComputerScien.epub - (EPUB全文下载)