How to Think Like a Computer Scientist
Learning with Python
by Allen B. Downey, Jeffrey Elkner and Chris Meyers
Printed copies now available from Green Tea Press.
Table of Contents
Foreword
Preface
Contributor List
Chapter 1: The way of the program
Chapter 2: Variables, expressions, and statements
1. Values and types
2. Variables
3. Variable names and keywords
4. Statements
5. Evaluating expressions
6. Operators and operands
7. Order of operations
8. Operations on strings
9. Input
10. Composition
11. Comments
12. Glossary
13. Exercises
Chapter 3: Functions
1. Function calls
2. Type conversion
3. Type coercion
4. Math functions
5. Composition
6. Adding new functions
7. Definitions and use
8. Flow of execution
9. Parameters and arguments
10. Variables and parameters are local
11. Stack diagrams
12. Functions with results
13. Glossary
14. Exercises
Chapter 4: Conditionals and recursion
1. The modulus operator
2. Boolean values and expressions
3. Logical operators
4. Conditional execution
5. Alternative execution
6. Chained conditionals
7. Nested conditionals
8. The return statement
9. Recursion
10. Stack diagrams for recursive functions
11. Infinite recursion
12. Tail recursion
13. Keyboard input
14. Glossary
15. Exercises
Chapter 5: Fruitful functions
Chapter 6: Iteration
1. Multiple assignment
2. The while statement
3. Tables
4. Two-dimensional tables
5. Encapsulation and generalization
6. More encapsulation
7. Local variables
8. More generalization
9. Functions
10. Glossary
11. Exercises
Chapter 7: Strings
1. A compound data type
2. Length
3. Traversal and the for loop
4. String slices
5. String comparison
6. Strings are immutable
7. The in operator
8. A find function
9. Looping and counting
10. Optional paramters
11. The string module
12. Character classification
13. Glossary
14. Exercises
Chapter 8: Lists
Chapter 9: Tuples
Chapter 10: Dictionaries
1. Dictionary operations
2. Dictionary methods
3. Aliasing and copying
4. Sparse matrices
5. Hints
6. Long integers
7. Counting letters
8. Glossary
9. Exercises
Chapter 11: Files and exceptions
Chapter 12: Classes and objects
Chapter 13: Classes and functions
Chapter 14: Methods
1. Object-oriented features
2. print_time
3. Another example
4. A more complicated example
5. Optional arguments
6. The initialization method
7. Points revisited
8. Operator overloading
9. Polymorphism
10. Glossary
11. Exercises
Chapter 15: Sets of objects
Chapter 16: Inheritance
Chapter 17: Linked Lists
Chapter 18: Stacks
Chapter 19: Queues and priority queues
Chapter 20: Trees
DocTest Exercises
TkInter Exercises
Gasp Exercises
Appendix A: Debugging
Appendix B: Creating a new datatype
Appendix C: Doctests and test driven development
Appendix D: Complete Python listings
Appendix E: Recommendations for further reading
GNU Free Document License
Index
Comments (0)
You don't have permission to comment on this page.