How to Think Like a Computer Scientist: Interactive Edition
This interactive book is a product of the Runestone Interactive Project at Luther College, led by Brad Miller and David Ranum. There have been many contributors to the project. Our thanks especially to the following:
- This book is based on the Original work by: Jeffrey Elkner, Allen B. Downey, and Chris Meyers 
- Activecode based on Skulpt 
- Codelens based on Online Python Tutor 
- Many contributions from the CSLearning4U research group at Georgia Tech. 
- ACM-SIGCSE for the special projects grant that funded our student Isaac Dontje Lindell for the summer of 2013. 
- NSF 
The Runestone Interactive tools are open source and we encourage you to contact us, or grab a copy from GitHub if you would like to use them to write your own resources.
Table of Contents¶
- 1. General Introduction- 1.1. The Way of the Program
- 1.2. Algorithms
- 1.3. The Python Programming Language
- 1.4. Executing Python in this Book
- 1.5. More About Programs
- 1.6. What is Debugging?
- 1.7. Syntax errors
- 1.8. Runtime Errors
- 1.9. Semantic Errors
- 1.10. Experimental Debugging
- 1.11. Formal and Natural Languages
- 1.12. A Typical First Program
- 1.13. Comments
- 1.14. Glossary
- 1.15. Exercises
 
- 2. Simple Python Data- 2.1. Variables, Expressions and Statements
- 2.2. Values and Data Types
- 2.3. Type conversion functions
- 2.4. Variables
- 2.5. Variable Names and Keywords
- 2.6. Statements and Expressions
- 2.7. Operators and Operands
- 2.8. Input
- 2.9. Order of Operations
- 2.10. Reassignment
- 2.11. Updating Variables
- 2.12. Glossary
- 2.13. Exercises
 
- 3. Debugging Interlude 1
- 4. Python Turtle Graphics- 4.1. Hello Little Turtles!
- 4.2. Our First Turtle Program
- 4.3. The forLoop
- 4.4. Flow of Execution of the for Loop
- 4.5. Iteration Simplifies our Turtle Program
- 4.6. The range Function
- 4.7. The Accumulator Pattern
- 4.8. A Few More turtle Methods and Observations
- 4.9. Summary of Turtle Methods
- 4.10. Glossary
- 4.11. Exercises
 
- 5. Python Modules
- 6. Functions
- 7. Selection- 7.1. Boolean Values and Boolean Expressions
- 7.2. Logical operators
- 7.3. Precedence of Operators
- 7.4. Conditional Execution: Binary Selection
- 7.5. Omitting the else Clause: Unary Selection
- 7.6. Nested conditionals
- 7.7. Chained conditionals
- 7.8. Boolean Functions
- 7.9. Assert Statements
- 7.10. Glossary
- 7.11. Exercises
 
- 8. More About Iteration
- 9. Strings- 9.1. A Collection Data Type
- 9.2. Operations on Strings
- 9.3. Index Operator: Working with the Characters of a String
- 9.4. Length
- 9.5. String Comparison
- 9.6. Traversal and the forLoop: By Index
- 9.7. Strings are Immutable
- 9.8. The Accumulator Pattern with Strings
- 9.9. Characters
- 9.10. Summary
- 9.11. Glossary
- 9.12. Exercises
 
- 10. Lists
- 11. Classes and Objects
Appendices¶
Appendices
Acknowledgements¶
Acknowledgements
- Copyright Notice
- Preface to the Interactive Edition
- Whats the deal with Logging in?
- How to Contribute
- Acknowledgements
- Foreword
- Preface to the Third Edition
- The Rhodes Local Edition (RLE)
- Preface to the First and Second Editions
- Contributor List
- GNU Free Documentation License
- ADDENDUM: How to use this License for your documents