E-Book Overview
"How to Think Like a Computer Scientist: Learning with Python" is anintroduction to computer science using the Python programminglanguage. It covers the basics of computer programming, includingvariables and values, functions, conditionals and control flow,program development and debugging. Later chapters cover basicalgorithms and data structures.
E-Book Content
How to Think Like a Computer Scientist
Learning with Python
ii
How to Think Like a Computer Scientist Learning with Python
Allen Downey Jeffrey Elkner Chris Meyers
Green Tea Press Wellesley, Massachusetts
c 2002 Allen Downey, Jeffrey Elkner, and Chris Meyers. Copyright ° Edited by Shannon Turlington and Lisa Cutler. Cover design by Rebecca Gimenez. Printing history: April 2002: First edition. Green Tea Press 1 Grove St. P.O. Box 812901 Wellesley, MA 02482 Permission is granted to copy, distribute, and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being “Foreword,” “Preface,” and “Contributor List,” with no Front-Cover Texts, and with no BackCover Texts. A copy of the license is included in the appendix entitled “GNU Free Documentation License.” The GNU Free Documentation License is available from www.gnu.org or by writing to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307, USA. The original form of this book is LATEX source code. Compiling this LATEX source has the effect of generating a device-independent representation of a textbook, which can be converted to other formats and printed. The LATEX source for this book is available from http://www.thinkpython.com Publisher’s Cataloging-in-Publication (provided by Quality Books, Inc.) Downey, Allen How to think like a computer scientist : learn