所需积分/C币:10 2015-12-23 14:20:05 3.25MB PDF
收藏 收藏

If you want to learn how to program, working with Python is an excellent way to start. This hands-on guide takes you through the language a step at a time, beginning with basic programming concepts before moving on to functions, recursion, data structures, and object-oriented design. This second edi
Think Python Second edition Allen B. downey Think Python by allen b. downey Copyright 2016 Allen Downey. All rights reserved Printed in the united states of america Published by o'reilly Media, InC. 1005 Gravenstein Highway North, Sebastopol, CA 95472 O Reilly books may be purchased for educational, business, or sales promotional use Onlineeditionsarealsoavailableformosttitles( information, contact our corporate/institutional sales department: 800-998-9938 or a Editor: Meghan Blanchette Production editor: kristen brown a Copyeditor: Nan Reinhardt a Proofreader: Amanda Kersey Indexer: Allen Downey a Interior Designer: David Futato a Cover designer: Karen montgomery a Illustrator: rebecca demarest a August 2012: First Edition a December 2015 Second edition Revision history for the second edition a 2015-11-20: First release See The O'Reilly logo is a registered trademark of o'reilly media, Inc. Think Python, the cover image of a Carolina parrot and related trade dress are trademarks of o'reilly Media Inc While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk if any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights Think Python is available under the Creative Commons Attribution-Non Commercial 3.0 Unported License. The author maintains an online version at 978-1-49193936-9 LSI Preface The Strange History of This Book In January 1999 i was preparing to teach an introductory programming class in Java. I had taught it three times and i was getting frustrated The failure rate in the class was too high and, even for students who succeeded the overall level of achievement was too low One of the problems i saw was the books. They were too big, with too much unnecessary detail about Java, and not enough high-level guidance about how to program. And they all suffered from the trapdoor effect: they would start out easy, proceed gradually, and then somewhere around Chapter 5 the bottom would fall out. The students would get too much new material, too fast, and i would spend the rest of the semester picking up the pieces Two weeks before the first day of classes, I decided to write my own book. My goals were Keep it short. It is better for students to read 10 pages than not read 50 pages a Be careful with vocabulary i tried to minimize jargon and define each term at first use a Build gradually. To avoid trapdoors, I took the most difficult topics and split them into a series of small steps Focus on programming, not the programming language I included the minimum useful subset of java and left out the rest needed a title, so on a whim i chose how to Think like a Computer Scientist My first version was rough, but it worked. Students did the reading, and they understood enough that I could spend class time on the hard topics, the interesting topics and(most important) letting the students practice I released the book under the gnu free documentation license, which allows users to copy, modify, and distribute the book. What happened next is the cool part. Jeff Elkner, a high school teacher in Virginia, adopted my book and translated it into Python He sent me a copy of his translation, and I had the unusual experience of learning Python by reading my own book. As Green Tea Press, I published the first Python version in 2001 In 2003 I started teaching at Olin College and i got to teach Python for the first time. The contrast with Java was striking. Students struggled less, learned more, worked on more interesting projects, and generally had a lot more fun Since then I've continued to develop the book, correcting errors, improving some of the examples and adding material, especially exercises The result is this book, now with the less grandiose title Think Python. Some of the changes are a I added a section about debugging at the end of each chapter. These sections present general techniques for finding and avoiding bugs, and warnings about Python pitfalls - I added more exercises, ranging from short tests of understanding to a few substantial projects. Most exercises include a link to my solution I added a series of case studies-longer examples with exercises, solutions, and discussion I expanded the discussion of program development plans and basic design patterns I added appendices about debugging and analysis of algorithms The second edition of Think Python has these new features The book and all supporting code have been updated to Python 3 I added a few sections, and more details on the Web, to help beginners get started running Python in a browser, so you dont have to deal with installing Python until you want to For"The turtle Module"I switched from my own turtle graphics package, called Swampy, to a more standard Python module, turtle, which is easier to install and more powerful a I added a new chapter called"The Goodies",which introduces some additional Python features that are not strictly necessary, but sometimes handy I hope you enjoy working with this book, and that it helps you learn to program and think like a computer scientist, at least a little bit Allen b. downey Olin College

试读 447P
限时抽奖 低至0.43元/次
身份认证后 购VIP低至7折
  • 至尊王者

关注 私信
最新推荐 10积分/C币 立即下载

试读结束, 可继续阅读

10积分/C币 立即下载