Jump to ratings and reviews
Rate this book

Introduction to Computation and Programming Using Python

Rate this book
The new edition of an introduction to the art of computational problem solving using Python.

This book introduces students with little or no prior programming experience to the art of computational problem solving using Python and various Python libraries, including numpy, matplotlib, random, pandas, and sklearn. It provides students with skills that will enable them to make productive use of computational techniques, including some of the tools and techniques of data science for using computation to model and interpret data as well as substantial material on machine learning.

The book is based on an MIT course and was developed for use not only in a conventional classroom but in a massive open online course (MOOC). It contains material suitable for a two-semester introductory computer science sequence.

This third edition has expanded the initial explanatory material, making it a gentler introduction to programming for the beginner, with more programming examples and many more “finger exercises.” A new chapter shows how to use the Pandas package for analyzing time series data. All the code has been rewritten to make it stylistically consistent with the PEP 8 standards. Although it covers such traditional topics as computational complexity and simple algorithms, the book focuses on a wide range of topics not found in most introductory texts, including information visualization, simulations to model randomness, computational techniques to understand data, and statistical techniques that inform (and misinform) as well as two related but relatively advanced topics: optimization problems and dynamic programming. The book also includes a Python 3 quick reference guide.

664 pages, Paperback

First published January 18, 2013

532 people are currently reading
1106 people want to read

About the author

John V. Guttag

7 books16 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
213 (43%)
4 stars
197 (39%)
3 stars
69 (13%)
2 stars
12 (2%)
1 star
3 (<1%)
Displaying 1 - 30 of 45 reviews
Profile Image for BCS.
218 reviews33 followers
December 17, 2013
I chose to read and review this book purely based on the title rather than doing my normal level of research. I was interested in learning more about the Python language, partly because I use Jython on a regular basis (Jython is an implementation of Python, written in Java).

Had I done my research more fully, I would have read this paragraph, which clearly outlines the purpose and content of the book:

‘This book introduces students with little or no prior programming experience to the art of computational problem solving using Python and various Python libraries, including PyLab. It provides students with skills that will enable them to make productive use of computational techniques, including some of the tools and techniques of “data science” for using computation to model and interpret data.’

This book should not be considered an introduction to Python; it is, in fact, precisely what the title suggests: an introduction to computation and programming using Python.

The difference may sound quite subtle, and perhaps a bit negative. However, that is the precise opposite of what I want to suggest - this is an excellent book, one that I would have dearly loved to have when I first started to learn the subject of computer science back in the 1980s.

The book begins by introducing Python, including the basic elements of the language such as objects, expressions, typing, variables, branches and strings. Much of this is very translatable to other languages and would be useful to anyone learning the basic fundamentals of computer programming, regardless of the language.

It then continues to explain the fundamentals of programming, including functions, abstraction, testing, debugging, exception handling and object-oriented (OO) programming.

At that point, the book dives into the science element of computer science, including algorithmic complexity, probability theory, graphing and statistical analysis.

At every stage, the author provides copious examples of how each particular problem can be illustrated/ solved using Python, using the building blocks introduced in the early chapters.
In its entirety, the book should be considered an excellent introduction to computer science and programming - as mentioned previously, I'd have loved to have this book when I started out in information science some 30 years ago.

However, if one's objective is to learn Python, it will be necessary to supplement this book with some specific Python tutorials, although the first few chapters will definitely help to establish context and understand the fundamental building blocks of the language.

Even one such as I, who has been working in the IT industry for nearly 30 years, got a huge amount of value from this book, as much of the content provided some good reminders of things that I'd since forgot, including probability and statistical analysis.

In conclusion, I can strongly recommend this book (provided that one reads the title in full) as a manual for budding computer scientists, as well as an introduction to the Python programming language.

Reviewed by David Hay MBCS CITP, IBM Software Services for WebSphere (ISSW)
101 reviews81 followers
August 24, 2018
برای یادگیری برنامه نویسی من فقط دنبال سینتکس نبودم. می خواستم راه و رسم فکر کردن به زبون برنامه نویس ها رو یادبگیرم و تو این راه کتاب های زیادی رو امتحان کردم. از کتاب زِد شا گرفته که بیشتر تمرین گوگل کردن و تایپ ده انگشتی بود:-|تا کتاب کرش کورس پایتون که سینتکس رو عالی توضیح داده بود و آخرش هم چند تا پروژه برای کار کردن واقعی با پایتون تعریف کرده بود. اما هیچ کدوم از اینا نمی تونست به فراگیری تفکر برنامه نویسی کمکی بکنه.
این شد که رفتم سراغ ویدیو های دانشگاه ام آی تی. این کتاب در دو تا کورس متفاوت آموزش داده می شه که تقریبا تمام متریال آموزشیش برای همه قابل دسترسه. کتاب رو با ویدیوهای خود استاد ها پیش بردم و تقریبا نیمی ازش رو کاور کردم. و چه قدر توی این یک ماه از پایتون لذت بردم. از سادگیش و زیباییش و توجهش به چیزای مهم نه صرفا سمی کالنی که ما رو سر کلاسای مبانی کامپیوتر بیچاره می کرد:دی (دیروز به یه کد سی پلاس پلاس برخوردم که می خواست یه چیزی رو روی صفحه چاپ کنه. وحشت زده متواری شدم از محل:-/)
کتاب رو نصفه خونده ام ولی مطالب کتاب در حال حاضر تا همین جا به دردم می خوردن. قرار نیست شغل آینده ام برنامه نویسی باشه بنابراین همین قدر که در این کتاب پیش رفتم برام کافیه. بهش با کمال میل پنج ستاره ی کامل می دم به خاطر این که تونست توی برنامه نویسی بهم دید بده:)
Profile Image for 龍帝.
73 reviews1 follower
January 11, 2014
It's a good book, a bit too academic and too abstract explaining OOP... If read while following the MITx lecture it's handy but still complicated for an Introduction, because it's full of computer science jargon that doesn't explain anything to novice.

If you are not already a programmer and want to learn python, read "Python the hard way" and the educational materials from the Google dev center.
Profile Image for Loukas Arvanitis.
4 reviews
May 29, 2013
Very good introductory book - used it as part of EdX's MOOC course and it helped me a lot. Highly recommended.
Profile Image for Ender Yolagel.
4 reviews6 followers
September 3, 2020
This text by The MIT Press covers MITx's program of Computational Thinking using Python on edX. You can also take OCW versions of these courses for free.

Chapters 1-11 covers 6.0001 and 11-24 covers 6.0002.
* 6.0001 - Introduction to Computer Science and Programming in Python (Fall 2016)
* 6.0002 - Introduction to Computational Thinking and Data Science (Fall 2016)

The book is an introduction to software engineering. It's a computer science course, not a Python course!
It covers a wide range of topics computational complexity, data structures, OOP and dynamic programming etc.

During some parts, it leads you think/question as if this is Python, not C# or Java, but remember it's a CS course. So the introduction has to be general enough that it gives you a feel for everything.

Code examples, particularly for the implementation of different computational models (optimization, statistical and simulation models), guide you on how to think like a computer scientist.
Profile Image for Ji.
175 reviews51 followers
January 1, 2020
This is obviously one of the best written technical books. The teaching style is fun and straightforward. The material is rid of any redundancy so that a quick learning of the essential parts about computation was made possible. Definitely worth reading and re-reading.
Profile Image for Aaron Schumacher.
203 reviews11 followers
January 18, 2022
Introduction to Computation and Programming Using Python is the book you should get if you think you want to learn Python. It packs in tons of sophisticated content and makes it accessible, not dumbed down.

This book seems to be something of a hidden gem. It isn't what comes up first when you search for Python resources. It doesn't have a lot of flash or promotion behind it. Of course it does have the weight of its publisher, The MIT Press. And there's the blurb on the back cover from Hal Abelson, coauthor of Structure and Interpretation of Computer Programs. So there are clear signs of the book's quality.

One example of what's good about this book is the explanation of hashing. This is a very important topic, but it has a little bit of complexity to it and so it's often almost entirely omitted when teaching people to code. This is the depth sometimes given in introductory Python courses:

# A Python dictionary is a set of key-value pairs
my_dict = {'a_key': 'a_value', 'another_key': 'another_value'}
# which allows access to the values via the keys (lookup)
my_dict['another_key'] # 'another_value'
# This data structure is also known as a `map` or `hash-map`

That's true, and you can start to use the language functionality with that, but it doesn't help you understand the underlying key idea. This book's explanation is much more complete.
Profile Image for Steven.
55 reviews2 followers
February 5, 2017
An introduction to sotware engineering and data science for beginners, who are generally assumed to be non-specialist engineering or science students with a background in algebra and the scientific method. Data science is maybe taking it too far: really it's basic computational statistical analytics. Both halves of the book use Python. It's a college textbook, used in the MIT subject 6.00 and its online MOOC counterpart 6.00x. This edition of the book is based on Python 2.7; more recent editions use 3.5. As in many MIT presentations, there's not a lot of hand-holding -- things move fast and you may have to supplement with other material to fill in leaps in the exposition. But the overall arc of the book provides a solid course of study for those just getting started with computer programming and computational data analysis, two skills no scientist or engineer should be without.
Profile Image for Muhammad Yousef.
13 reviews13 followers
June 30, 2017
A practical introduction to computation from MIT Press.
This book walks you through the vast majority of computational techniques that you need to know as a software engineer.
It covers a wide range of traditional topics such as computational complexity, basic data structures, Object-oriented programming and dynamic programming.
also, It provides students with a comprehensive bird's eye to Data Science so, if you are interested, I can assure you that it will be an excellent place to start.
Although it uses Python, this is not a python book!
so, If you have no experience with the language yet, I encourage you to learn about it before you dive deeply in the contents of this book.
Profile Image for Jovany Agathe.
281 reviews
March 19, 2018
i am very pleased with the book. It is terse and fast. If you require a more leisurely pace, John Zelle's Python Programming, an Introduction to Computer Science takes 425 pages to cover what this book covers in 110 pages, and then has a short chapter just touching on what this book covers more deeply in the remaining 200 pages. Zelle's book is also a popular first year CS text, but obviously for a different audience. Obviously, you will learn more with this book if you can take the pace. I bought Zelle's book also and have used it for extra exercises and the occasional alternative explanation.
Profile Image for Andrew Breza.
491 reviews30 followers
October 8, 2019
I'm a data scientist with extensive experience using the R programming language. I'm adding Python to my toolkit and this is exactly the right book for learning not only Python syntax but also how to use object oriented code to solve real problems.
Profile Image for Prabhat.
49 reviews43 followers
March 11, 2015
Smart basics... hidden nuggets of wisdom... off-beat statistical bent... elementary but nontrivial.
Profile Image for Alex.
49 reviews5 followers
May 12, 2015
If you know a bit python syntax, this is the best self-contained intro book to computer and data science.
9 reviews8 followers
September 30, 2020
This is easily the best first book for anyone who wants to learn to program. But this book requires more effort than other introductory books but the extra work will set you on the right track.
Profile Image for Uriel Vidal.
125 reviews1 follower
July 12, 2020
Este libro es como si fuera un gran y excelente buffet en donde se puede probar todos los conceptos de la teoría de la informática, además el autor tiene en sus notas un sentido del humor muy acorde a lo que es está describiendo y datos interesantes acerca de la teoría que está describiendo, es como si un buen maestro té está dando una clase y hace comentarios para no aburrir.
Con respecto a los temas, es excepcional cómo cómo simplifica conceptos y los hace digeribles, aunque el código que coloca se le tiene que dar una gran mirada para poder entenderlo. Por cierto, da un gran repaso a estadística e hizo que pudiera entender conceptos mejor de lo que lo había hecho en clase o en otros libros, por ejemplo las pruebas estadísticas.
Aunque es un libro que dice Python, no es un libro sobre el lenguaje, sino que se ayuda de él para hacer las explicaciones por su sencillez y que de haberlo hecho en otro lenguaje, hubiera sido el código más complejo.
Es un gran libro que está dirigido s personas entusiastas de la programación y también sirve mucho para dar un repaso a todos esos rubros que alguna vez se estudiaron o que pasaron de largo.
En definitiva es un gran libro como para tener de referencia y de consulta.
Profile Image for Jeff Patterson.
106 reviews6 followers
December 9, 2023
Took quite some time to complete. Not the fault of the book. Rather, the reader didn't prioritize the material as I needed to follow along with the OCW MIT video lessons posted on YouTube. This edition of the book is newer than the one used in the videos, and it had additional chapters that were not exactly in sync with the videos, but if you are interested in following along, you shouldn't have any trouble figuring out the reading for each video.

Link to video playlist on YouTube
For the first half of the book
The second half
167 reviews19 followers
January 8, 2020
I skimmed through the book picking up the concepts taught from the author's point of view. The interesting part here was, the author introduces a number of scientific methods and presents a real-world use-case before demonstrating the scientific method using Python. One interesting thing I had picked up from this book was Buffon's method for calculating Pi, which was extremely simple and serves good exercise to do in any programming language. I think this book is aimed at science students, like high school or bachelor who have learned science the traditional way and want to pick up computation and python.
Profile Image for Mike.
19 reviews
November 13, 2024
Very pleasant read. Well-written, with a lot of information and a great approach to presenting it. I'd say it is a very good introduction to Python. I already knew Python and was more interested in the Computation part of this book, which is introduced also very neatly. The major flaw (for some, I suppose) of this book is that it is just an Introduction, and most of the information will seem simple and superficial to those with some knowledge of the subject. Not a lot of knowledge, some.
As a whole though, I wish I had this book when I was starting with Python, Probabilities, and Computation. It is a great book!
Profile Image for jacques tree cartesian.
22 reviews4 followers
January 21, 2021
still half way of all pages, but i think that's enough to accomplished my purpose to learn about basic of computer science with python. the other half page is about how to solving problem like knapsack problem and most of them about statistics probability, getting to know the data and machine learning. grateful to know and read this as my first reference as i was have no knowledge of computer science or programming before. it really covers the basic and best as pair when watching playlist of mit 6.0001.
Profile Image for Skywalker Hu.
135 reviews3 followers
December 7, 2023
3rd time reading the book and finally finished, along with MIT's 6.00.1x and 6.00.2x. Note that you can pay $300 USD for 1x's college credit from Charter Oak Community College. Weird but helpful in some cases.

An excellent read and fantastic introduction to the world of programming. I am glad that I did the courses and really hope I had this professor and this book 10 years ago when I first met computer programming. My life might be on a different trajectory now.
47 reviews
June 9, 2020
I got 2/3 of the way through but it's just too abstract with it's examples to be helpful. It would probably be a good reference if you were reading it while taking the MIT free course but if you are just looking to read and do problems on your own, then find an easier book to follow.
Profile Image for Ayham أيهم.
78 reviews5 followers
October 4, 2023
Read the first half of the book as part of the MIT Introduction to Computer Science and Programming Using Python course on Edx. Credits to Prof. Eric Grimson. He is a great teacher!

The second part is taught by Prof. John Guttag. Looks interesting :)
5 reviews
January 29, 2019
Very Technical Book, and Very Detailed One. Worth Your Time.
if you find it hard to read, start with Zelle's Python Programming.
Profile Image for Yannik.
4 reviews
August 5, 2019
Only read the first half of the book that corresponds to the lectures in the MITx 6.00.1 course. Might come back in the future to browse through the second half.
2 reviews
June 20, 2021
It takes a good view of programming in various fields.
Profile Image for Jawwad Zafar.
95 reviews
June 29, 2021
Read along the MIT OCW Introduction to Computation and Programming Using Python and I can say either you just read the book or watch the videos they have same amount of knowledge.
Displaying 1 - 30 of 45 reviews

Can't find what you're looking for?

Get help and learn more about the design.