Think Python
How to Think Like a Computer Scientist
Publisher: O'Reilly Media
Released: August 2012
Pages: 300

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 one step at a time, beginning with basic programming concepts before moving on to functions, recursion, data structures, and object-oriented design.

Through exercises in each chapter, you’ll try out programming concepts as you learn them. Think Python is ideal for students at the high school or college level, as well as self-learners, home-schooled students, and professionals who need to learn programming basics.

  • Start with the basics, including language syntax and semantics
  • Get a clear definition of each programming concept
  • Learn values, variables, statements, functions, and data structures in a logical progression
  • Discover how to work with files and databases
  • Understand objects, methods, and object-oriented programming
  • Use debugging techniques to fix syntax, runtime, and semantic errors
  • Explore interface design, data structures, and GUI-based programs through case studies
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyThink Python
 
3.1

(based on 8 reviews)

Ratings Distribution

  • 5 Stars

     

    (1)

  • 4 Stars

     

    (4)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (2)

71%

of respondents would recommend this to a friend.

Pros

  • Well-written (6)
  • Concise (5)
  • Easy to understand (5)
  • Helpful examples (5)
  • Accurate (4)

Cons

    Best Uses

    • Novice (7)
    • Student (6)
      • Reviewer Profile:
      • Developer (3), Sys admin (3)

    Reviewed by 8 customers

    Sort by

    Displaying reviews 1-8

    Back to top

    (2 of 7 customers found this review helpful)

     
    2.0

    Essential material missing

    By CharlesB

    from London

    Pros

      Cons

      • Too many errors

      Best Uses

        Comments about oreilly Think Python:

        As another reviewer has noted, this book is intended for beginners in the language (which I am), and then fails to distinguish version 2.x and version 3 code, so if you have forgotten that print is a function with () in 3.

        More serious problems are found in Chapter 4 (where I am now). There is a package required for this chapter - but no description of how to install a package in Python. There is supposed to be a site with relevant code on however the installation instructions for a Windows machine are cursory, unclear (why am I importing tkinter, what is it? and what is pip, is it important and what if it is not installed?) and include such gems as running:

        sudo python setup.py install

        Funnily enough, the Windows command line did not understand sudo.

        I have tried what appear to be all the alternative versions and none work.

        Look like I'll have to skip all the examples requiring this code.

        I usually find O'Reilly books reliable, consistent and demonstrating excellent editorial control (vital, given the subject matter). But so far, not very good at all.

        (1 of 8 customers found this review helpful)

         
        1.0

        Avoid at all costs

        By Hitsuji

        from Cork, Ireland

        About Me Developer, Sys Admin

        Verified Reviewer

        Pros

          Cons

          • Not comprehensive enough
          • Too basic

          Best Uses

          • Novice

          Comments about oreilly Think Python:

          Might be OK for an absolute beginner learning their first language, but for anyone else: avoid. Given the name "Think Python" I expected the book to cover programming topics specific to python, but instead found that it avoids Python specifics and instead attempts to describe only topics that occur across most languages. The language used is extremely childish and approx 33% - 50% of the book appears to be purely exercises. The book is also not very logically structured, related concepts, such as "*= operator" and "+= operator" are introduced several chapters apart, and after introducing the += operator, the author continues to use the "x = x + y" style.

          (4 of 4 customers found this review helpful)

           
          4.0

          An effective way to learn Python

          By Irina_T

          from Sofia, Bulgaria

          About Me Educator

          Pros

          • Accurate
          • Concise
          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

          • Too basic

          Best Uses

          • Intermediate
          • Novice
          • Student

          Comments about oreilly Think Python:

          Full Disclosure: I obtained a free copy of this book as part of the O'Reilly Review program.

          Even if Python's syntax is very intuitive and simple, learning to program in it still represents a burden for non-specialists.

          Differently from other learning-to-program books, "Think Python" introduces the programming beginners both into the language and in the computer science logic behind it. In this way, the book becomes perfect both for self-learners and for those who teach Python to programming beginners, as it introduces gradually all important programming basics concepts, such as debugging, stack diagrams, development plan, catching exceptions and helps readers in solving these tasks. Although it is written for beginners, the book is spanning over everything, and thus can be useful also for more advanced learners: starts with the simplest concepts, such as variables definition, and ends up with modules to process databases and search algorithms analysis. A good thing is also that the book introduces functional programming since the beginning, and by this teaches the best programming practices.

          The book is written in a very simple language, uses glossaries, and attractive exercises, like using turtles objects to draw shapes, drawing fractals or processing project Gutenberg books. The exercises have been specially developed for this book, and are available on the author's website.

          In addition, the book contains a couple of chapters with exercises relevant to Computational linguistics tasks, such as word frequency, or random text generation, so it would also introduce the interested readers into ways of solving the field's tasks, before switching to a more advanced Python for NLP book, such as O'Reilly's Natural Language Processing with Python. Go for it: It is fun, easy, not scary, and effective! :)

          (6 of 6 customers found this review helpful)

           
          4.0

          A Concise Intro to Python Programming

          By IT_Voyager

          from Ventura, CA

          About Me Solution Architect

          Verified Reviewer

          Pros

          • Accurate
          • Concise
          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Novice
            • Student

            Comments about oreilly Think Python:

            Full Disclosure: I obtained a free copy of this book as part of the O'Reilly Blogger Review program.

            Allen B. Downey's recent release (from O'Reilly) - 'Think Python' is an excellent example of how an introductory programming book should be crafted.

            Clear, concise, entertaining, insightful, crisp, useful - these are some of the words that come to mind while reading this book.

            There is good coverage of some of the differences between Python 2 and 3.

            This is an excellent text for the novice programmer to learn Python - providing a general purpose overview of the language. The interested reader will find enough learning
            traction within this book to more easily proceed to more advanced texts.

            Programming concepts are gradually introduced, with successive layers of refinement adding further understanding of more complex programming concepts.

            At the end of each chapter are suggested exercises to further deepen the reader's grasp of the concepts just presented.

            The inclusion of links to codes samples and solutions at the http://thinkpython.com site is a nice touch.

            While this book provides a very light overview of some essential software design concepts (Functions, Encapsulation, Generalization, Recursion, Inheritcance, Polymorphism), the reader of this book should plan to further enhance their understanding with supplemental books to cover deeper functional programming concepts as well as deeper understanding of class design and object oriented concepts.

            It is notable that although this book certainly fits into the classification category of introductory - the coverage includes an uncommon attention to such important matters
            as debugging and analysis of algorithms. As an additional bonus, Appendix C provides a discussion of Lumpy ("...to examine the state of a running program and generate object diagrams...and class diagrams) - which is included in the Swampy code discussed early in the book.

            (3 of 4 customers found this review helpful)

             
            4.0

            Suitable for university courses

            By lyhcode

            from Taiwan

            About Me Developer, Programmer

            Verified Reviewer

            Pros

            • Concise
            • Easy to understand
            • Helpful examples
            • Well-written

            Cons

            • Too Few Exercises

            Best Uses

            • Novice
            • Student

            Comments about oreilly Think Python:

            This book uses the Python programming language. Python as the first language for computer science students are very well. This book contains many required concepts and knowledge for programming basics, as well as implementation exercises can help educators teaching.

            (5 of 5 customers found this review helpful)

             
            4.0

            Good intro to programming

            By datopdog

            from Johannesburg, RSA

            About Me Developer, Sys Admin

            Verified Reviewer

            Pros

            • Accurate
            • Concise
            • Easy to understand
            • Helpful examples
            • Well-written

            Cons

              Best Uses

              • Novice
              • Student

              Comments about oreilly Think Python:

              Being an introduction to programming using the Python language this book strikes a good balance between explaining the programming theory and translating that into the Python Language.

              All the fundamentals of programming are touched on, and there are examples to illustrate these concepts as well as exercises to get the reader to try and solve specific problems since programming is all about problem solving.

              The downside for me was that all the examples involved some mathematical concept or formula, not many "real world" examples. Although this is more of an introduction to programming using the python language, i would think python specific concepts like modules and the standard library should have atleast featured even if as appendixes.

              All in all, for anyone new to programming this is a great book to start with.

              (8 of 8 customers found this review helpful)

               
              5.0

              Good Code Samples

              By Eric Chou

              from Seattle, WA

              About Me Sys Admin

              Pros

              • Accurate
              • Concise
              • Easy to understand
              • Helpful examples
              • Well-written

              Cons

                Best Uses

                • Novice
                • Student

                Comments about oreilly Think Python:

                This book is a good balance between examples and theory, in my opinion. The most difficult part that I find when learning something new is to have simple examples, but not simpler. The examples should be precise enough to illustrate the point quickly, but without all the extra baggages or make the reader jump thru a lot of hoops (so- called Yak Shaving). This is very difficult. I think the author goes thru the distance to make sure that is the case. In fact, there are a few early examples that I think can be made simpler and shorter by importing standard modules (RE, for example) but the author goes thru great length to make sure the examples only uses the tools that was already introduced.

                I enjoyed reading Chapter 15 - 17 on objects, functions, and methods within Classes. I am not brand new to Python, but I found the chapters were informative and fill in a lot of the gaps for me.

                The only suggestion I have would be to still go with subprocess instead of os.popen() since subprocess is suppose to replace a host of old modules. Also I think it would be helpful is there is a section at the end of the later chapter on where to go next if you so inclined on the particular topic. Say if you want to use wxPython instead of Tkinter or some online resources on Object Oriented Programming.

                All in all, I think this is a great learning book on Python.

                ps. also, as a side note to the other review on Python 2 vs. Python 3, on section 1.5 'Your First Program':
                "... In Python 3, the syntax for printing is slightly different: print(' Hello, World!')For the rest of this book, I'll use the print statement. If you are using Python 3, you will have to translate. But other than that, there are very few differences we have to worry about."

                (9 of 32 customers found this review helpful)

                 
                1.0

                Un-clear if the book teach 2.7 or 3.X

                By Leopold Birkholm

                from Stockholm, Sweden

                About Me Self-learning

                Verified Reviewer

                Pros

                • Well-written

                Cons

                • Un-clear on version

                Best Uses

                • Novice
                • Student

                Comments about oreilly Think Python:

                * I am using this book to learn about writing code in the language Python.
                * The are one big bump right in the beginning that de-rails the rest. The teacher is not clear on if this book is teaching me as a reader the version 2.7 or the 3.X version of Python. Why is that important? It's because the syntax is quite different between version 2.7 and 3.X. As an example:
                version 2.7: code "print 'Hello, World!'"
                version 3.X: code "print('Hello, World!')"

                Now, you might think that is no biggy. But think of what this means when you are writing several programs, in total of hundreds of rows of code. Have that in mind when reading this book.

                Displaying reviews 1-8

                Back to top

                 
                Buy 2 Get 1 Free Free Shipping Guarantee
                Buying Options
                Immediate Access - Go Digital what's this?
                Ebook: $31.99
                Formats:  DAISY, ePub, Mobi, PDF
                Print & Ebook: $43.99
                Print: $39.99