Welcome to computer science in the 21st century. Did you ever wonder how computers represent DNA? How they can download a web page containing population data and analyze it to spot trends? Or how they can change the colors in a color photograph? If so, this book is for you. By the time you’re done, you’ll know how to do all of that and a lot more. And Python makes it easy and fun.

Practical Programming, 2nd Edition is available here.

Out of Print

This book is currently out of print.

About this Book

  • 346 pages
  • Published:
  • Release: P4.0 (2011-10-14)
  • ISBN: 978-1-93435-627-2

Computers are used in every part of science from ecology to particle physics. This introduction to computer science continually reinforces those ties by using real-world science problems as examples. Anyone who has taken a high school science class will be able to follow along as the book introduces the basics of programming, then goes on to show readers how to work with databases, download data from the web automatically, build graphical interfaces, and most importantly, how to think like a professional programmer.

Topics covered include:

  • Basic elements of programming from arithmetic to loops and if statements.
  • Using functions and modules to organize programs.
  • Using lists, sets, and dictionaries to organize data.
  • Designing algorithms systematically.
  • Debugging things when they go wrong.
  • Creating and querying databases.
  • Building graphical interfaces to make programs easier to use.
  • Object-oriented programming and programming patterns.

Answers to selected exercises are available online at www.cdf.toronto.edu/~pgries/pybook/

Contents and Extracts

Full Table of Contents

  • Introduction
  • Hello, Python excerpt
  • Strings
  • Modules excerpt
  • Lists excerpt
  • Making Choices
  • Repetition
  • File Processing
  • Sets and Dictionaries
  • Algorithms
  • Searching and Sorting
  • Construction
  • Object-Oriented Programming
  • Graphical User Interfaces
  • Databases

About the Author

Jennifer Campbell is a senior lecturer in Computer Science at the University of Toronto who created the course this book is based on. Paul Gries, also a senior lecturer, has won numerous teaching awards and authored other introductory computer science texts. Jason Montojo was a student of theirs who has since worked on the Eclipse programming platform at IBM; he is also a professional photographer and digital artist, and created all of the diagrams for this book. Greg Wilson worked in industry for many years before returning to academia; he has been using Python for over a decade, and has written several other programming books.