Home > Store

Learn to Program Using Python: A Tutorial for Hobbyists, Self-Starters, and All Who Want to Learn the Art of Computer Programming

Register your product to gain access to bonus material or receive a coupon.

Learn to Program Using Python: A Tutorial for Hobbyists, Self-Starters, and All Who Want to Learn the Art of Computer Programming


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2001
  • Dimensions: 7-1/2" x 9-1/4"
  • Pages: 288
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-70938-4
  • ISBN-13: 978-0-201-70938-4

Learn to Program Using Python is a rarity in today's marketplace: a great introduction to programming for true beginners. It started as a hugely popular Web tutorial; reflecting comments from learners worldwide, author Alan Gauld has extended it into book form, adding new material, deeper explanations, and more code examples. Gauld introduces programming through Python, an extremely popular language that's easy to start with, available on virtually every platform, and is powerful enough to serve your needs for years to come. He starts with the absolute basics: what programming is, and the character and mindset of a successful programmer. Next, he introduces the concepts of data, operations, sequences, and loops; and shows how to interact with users. Gauld then walks through branching, modules, functions, file handling, error handling, and recursion. Once you've mastered the basics, he introduces object-oriented programming, and more advanced techniques. The book concludes with two detailed object-oriented case studies. For all beginning programmers, power users, and users of other programming languages who want to learn Python.



This file contains the content from the CD-ROM included with the book Learn to Program Using Python by Alan Gauld, and is covered under the copyright and warranty notices in that book.


Related Article

An Introduction to Regular Expressions

Web Resources

Click below for Web Resources related to this title:
Author's Web Site

Sample Content

Table of Contents



1. Who, What, and How?
2. What Do I Need?
3. What Is Programming?
4. Getting Started.


5. Simple Sequences.
6. The Raw Materials.
7. More Sequences and Other Things.
8. Looping, or the Art of Repeating Oneself.
9. Decisions, Decisions.
10. Conversing with the User.
11. Modular Programming.
12. Handling Files and Text.
13. A Touch of Style.
14. Handling Errors.

III. Advanced Topics.

15. Recursion.
16. Namespaces.
17. Object-Oriented Programming.
18. Event-Driven Programming.
19. Regular Expressions.
20. Debugging.
21. Designing a Solution.

IV. Case Studies.

22. Grammar Counter.
23. Guessing Games.
Appendix A. Installing and Testing Python.
Appendix B. Some Interesting Programming Languages.
Appendix C. Resources.


Why Write This Book?

I started this tutorial in response to a request from two friends, both of whom were proficient computer users but wanted to go a step further and learn to program. As both had Internet access, I decided to save myself some trouble and find an online tutorial that they could use. Much to my amazement, this quest came up empty—it proved very difficult to find a tutorial that addressed the needs of an absolute beginner. Many tutorials taught specific programming languages, but they all assumed prior programming knowledge. This exercise provided sufficient motivation for me to create my own online tutorial for beginners. (You can see the online version at http://www.crosswinds.net/~agauld/. It's also on the CD-ROM as a Zip file.)

I had assumed that 10 to 20 pages would suffice, but the project grew and grew. Soon I had more than 50 pages of printout and was getting increasing numbers of visitors to my Web site, many of whom asked questions or required clarification of points. Responding to their requests, in turn, improved the quality and expanded the volume still further. Several readers suggested that the tutorial would make a useful book, and this text is the result.

My Background

I am a professional programmer who came to programming from an electronic engineering background. I've been involved with computers and the information technology industry since the mid-1970s, working on everything from embedded microcontrollers to mainframe billing systems. In that time I have used (and continue to use) several computer languages and operating systems.

A Word about Languages

For commercial reasons I have tried to use American English spellings and terminology throughout the book. This choice has led to some interesting discoveries about the differences between how American English and the rest of the English-speaking world do things. For those non-Americans who get irritated at the inexorable pollution of the Queen's English, I proffer my apologies and sympathy, but I hope you buy the book anyway! To U.S. readers, I hope that any remaining Anglicisms are not too offensive or confusing. Please consider them a quaint relic from the past.


As ever, this book's existence owes a lot to many people. In particular, I'd like to thank Ray and John, who started the ball rolling, as well as all the folks who visited and commented on the original online tutorial. Also meriting a mention are Matthew Curtin and Herb Sutter, both of whom urged me to "go for it," and Jeff, my boss at work, whose support further encouraged me. Next must come Mike Hendrickson and Heather Peterson, my editors at Addison-Wesley, who were never less than enthusiastic about the project. Finally, I'd like to thank Matt, Dave, Brian, Moira, and Perdita, who have been press-ganged into reviewing various drafts or had ideas bounced off them. I'd also like to thank the many technical reviewers whose comments have helped shape the direction of the book. They all spotted many mistakes; any that remain behind are solely mine. Finally, thanks to my wife, Heather, who patiently whiled away the many hours alone as I gazed haplessly at the PC.




Click below for Errata related to this title:

Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership