12.07.2015 Views

Think Python - Denison University

Think Python - Denison University

Think Python - Denison University

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

viChapter 0. PrefaceIn 2003 I started teaching at Olin College and I got to teach <strong>Python</strong> for the first time. The contrastwith Java was striking. Students struggled less, learned more, worked on more interesting projects,and generally had alot morefun.Over the last five years I have continued to develop the book, correcting errors, improving some oftheexamplesandaddingmaterial,especiallyexercises. In2008Istartedworkonamajorrevision—at the same time, I was contacted by an editor at Cambridge <strong>University</strong> Press who was interested inpublishing the next edition. Good timing!The resultisthis book, now withthe lessgrandiose title<strong>Think</strong> <strong>Python</strong>. Some of thechanges are:• I added a section about debugging at the end of each chapter. These sections present generaltechniques forfinding and avoiding bugs, and warnings about <strong>Python</strong> pitfalls.• I removed the material in the last few chapters about the implementation of lists and trees. Istilllove those topics, but Ithought they were incongruent withthe restof thebook.• Iaddedmoreexercises,rangingfromshorttestsofunderstandingtoafewsubstantialprojects.• I added a series of case studies—longer examples with exercises, solutions, and discussion.SomeofthemarebasedonSwampy,asuiteof<strong>Python</strong>programsIwroteforuseinmyclasses.Swampy, code examples, and somesolutions are available fromthinkpython.com.• I expanded thediscussion ofprogram development plans and basic design patterns.• The use of <strong>Python</strong> is more idiomatic. The book is still about programming, not <strong>Python</strong>, butnow Ithink thebook gets moreleverage from thelanguage.Ihopeyouenjoyworkingwiththisbook,andthatithelpsyoulearntoprogramandthink,atleastalittlebit,likeacomputer scientist.AllenB. DowneyNeedham MAAllen Downey is an Associate Professor of Computer Science at the Franklin W. Olin College ofEngineering.AcknowledgementsFirstandmostimportantly,IthankJeffElkner,whotranslatedmyJavabookinto<strong>Python</strong>,whichgotthisproject startedand introduced me towhat has turned out tobe myfavoritelanguage.I also thank Chris Meyers, who contributed several sections to How to <strong>Think</strong> Like a ComputerScientist.And I thank the Free Software Foundation for developing the GNU Free Documentation License,which helped make my collaboration withJeffand Chris possible.Ialsothank theeditors at Lulu who worked on How to<strong>Think</strong> Like aComputer Scientist.Ithankallthestudentswhoworkedwithearlierversionsofthisbookandallthecontributors(listedbelow) who sent incorrections and suggestions.AndIthankmywife,Lisa,forherworkonthisbook,andGreenTeaPress,andeverythingelse,too.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!