Preparing video…

Learn to Program: Crafting Quality Code

Not all programs are created equal.  In this course, we'll focus on writing quality code that runs correctly and efficiently.  We'll design, code and validate our programs and learn how to compare programs that are addressing the same task.


Course at a Glance

About the Course

Most programs are used for years and are worked on by many people. Having programs that are easy to understand is essential, in the same way that a well-organized essay is far easier to follow than a disorganized one. We’ll show you an approach that helps to break down problems into smaller tasks that are easier to both solve and read.
This design approach also makes it more straightforward to find and fix flaws. You'll be introduced to the tools that professional programmers use; they're called "testing" and "debugging".
For most complex problems, there are many programs that solve them. Some are inherently slower than others. You'll learn how to read two programs and compare them for efficiency.

Recommended Background

This course assumes “Learn To Program: The Fundamentals”, or similar background.  You should be comfortable with these topics in Python 3:

  • Function definition, function call, method call
  • Types: bool, int, float, str, list, dict, tuple
  • Control structures: if, for, while
  • File reading and writing
You should also be familiar with the function design recipe, the Python visualizer, the IDLE debugger, and from Learn To Program: The Fundamentals.  If you did not take LTP1, please register, visit the class archive, and review at least these videos:

Week 1:

  • Python and Computer Memory
  • Variables
Week 2:
  • Docstrings and Function help
  • Function Design Recipe
  • Visualizing Function Calls
Week 3:
  • Functions, Variables, and the Call Stack
Week 4:
  • IDLE's Debugger
Week 5:
  • Mutability and Aliasing

Suggested Readings

Click to purchase

We are writing a textbook that matches the course material closely, and includes different examples and exercises than the ones you'll encounter in this course. It also covers the same course material as presented in Learn to Program: The Fundamentals.

This title is currently available in Beta. Buy the eBook now, and you'll be able to download successive releases of the eBook as we add material and correct mistakes. You'll get the final eBook when the book is finished. If you want more reading and practice before LTP2 starts on 25 March, this book is an excellent way to get it. You can choose to purchase an electronic version (PDF, ePub, mobi) as well as a paper book.

You can visit the Contents/extracts tab for Practical Programming (2nd edition) to see the progress; any chapter that lists subsections is included in the Beta.

Course Format

The class consists of 1 to 2 hours of lecture each week, which are made up of videos that are generally shorter than 12 minutes each. Each video contains integrated quiz questions. There are also weekly standalone exercises that are not part of the video lectures and a couple of programming projects.  Part of the course will involve grading projects submitted by other participants.


  • Will I get a Statement of Accomplishment after completing this class?

    Yes. Students who successfully complete the class will receive a Statement of Accomplishment signed by the instructor.

  • Can I do this course if I don’t know anything about programming?

    No, we expect this course to be taken by people who have some Python programming experience, such as “Learn To Program: The Fundamentals”.

  • Is there a textbook?

    Yes. We will provide more information about the book in early March.

  • What resources will I need for this class?

    We use the freely-available Python 3 and the IDLE development environment (which comes with Python 3). The download is available here: Download the most recent release of Python 3.