Practical Programming : An Introduction to Computer Science Using Python

  • ISBN13:


  • ISBN10:


  • Edition: 1st
  • Format: Paperback
  • Copyright: 2009-04-01
  • Publisher: Oreilly & Associates Inc
  • Purchase Benefits
  • Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $32.95


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.

Author Biography

Jennifer Campbell is a senior lecturer in Computer Science at the University of Toronto who created the course on which this book is based. 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.

Table of Contents

Introductionp. 1
Programs and Programmingp. 3
A Few Definitionsp. 4
What to Installp. 4
For Instructorsp. 5
Summaryp. 6
Hello, Pythonp. 7
The Big Picturep. 7
Expressionsp. 9
What Is a Type?p. 12
Variables and the Assignment Statementp. 15
When Things Go Wrongp. 19
Function Basicsp. 20
Built-in Functionsp. 23
Style Notesp. 24
Summaryp. 25
Exercisesp. 26
Stringsp. 29
Stringsp. 29
Escape Charactersp. 32
Multiline Stringsp. 33
Printp. 34
Formatted Printingp. 35
User Inputp. 36
Summaryp. 37
Exercisesp. 38
Modulesp. 41
Importing Modulesp. 41
Defining Your Own Modulesp. 45
Objects and Methodsp. 51
Pixels and Colorsp. 59
Testingp. 61
Style Notesp. 67
Summaryp. 68
Exercisesp. 69
Listsp. 73
Lists and Indicesp. 73
Modifying Listsp. 77
Built-in Functions on Listsp. 79
Processing List Itemsp. 81
Slicingp. 84
Aliasingp. 86
List Methodsp. 87
Nested Listsp. 89
Other Kinds of Sequencesp. 91
Files as Listsp. 92
Commentsp. 95
Summaryp. 97
Exercisesp. 97
Making Choicesp. 101
Boolean Logicp. 101
if Statementsp. 111
Storing Conditionalsp. 118
Summaryp. 119
Exercisesp. 120
Repetitionp. 125
Counted Loopsp. 125
while Loopsp. 134
User Input Loopsp. 142
Controlling Loopsp. 143
Style Notesp. 147
Summaryp. 148
Exercisesp. 149
File Processingp. 153
One Record per Linep. 154
Records with Multiple Fieldsp. 164
Positional Datap. 167
Multiline Recordsp. 170
Looking Aheadp. 172
Writing to Filesp. 174
Summaryp. 176
Exercisesp. 176
Sets and Dictionariesp. 179
Setsp. 179
Dictionariesp. 184
Inverting a Dictionaryp. 191
Summaryp. 192
Exercisesp. 193
Algorithmsp. 197
Searchingp. 198
Timingp. 205
Summaryp. 205
Exercisesp. 206
Searching and Sortingp. 209
Linear Searchp. 209
Binary Searchp. 213
Sortingp. 217
More Efficient Sorting Algorithmsp. 223
Mergesort: An Nlog2N Algorithmp. 224
Summaryp. 228
Exercisesp. 229
Constructionp. 233
More on Functionsp. 233
Exceptionsp. 238
Testingp. 245
Debuggingp. 250
Patternsp. 252
Summaryp. 256
Exercisesp. 257
Object-Oriented Programmingp. 267
Class Colorp. 268
Special Methodsp. 273
More About dir and helpp. 275
A Little Bit of OO Theoryp. 277
A Longer Examplep. 285
Summaryp. 290
Exercisesp. 290
Graphical User Interfacesp. 291
The Tkinter Modulep. 292
Basic GUI Constructionp. 293
Models, Views, and Controllersp. 298
Stylep. 304
A Few More Widgetsp. 309
Object-Oriented GUIsp. 313
Summaryp. 314
Exercisesp. 315
Databasesp. 319
The Big Picturep. 319
First Stepsp. 321
Retrieving Datap. 325
Updating and Deletingp. 328
Transactionsp. 329
Using NULL for Missing Datap. 331
Using Joins to Combine Tablesp. 332
Keys and Constraintsp. 337
Advanced Featuresp. 339
Summaryp. 344
Exercisesp. 345
A Bibliographyp. 349
Indexp. 351
Table of Contents provided by Ingram. All Rights Reserved.

Rewards Program

Write a Review