Learn to Code by Solving Problems: A Python Programming Primer Homepage for the book Learn to Code by Solving Problems: A Python Programming Primer

Solving Good Groups Using Dictionaries

Hello! We’re going to solve a problem here using Python dictionaries. I’m assuming that you’ve already studied the first eight chapters of Learn to Code by Solving Problems. If you have, you know how powerful Python dictionaries can be. Whenever you need to make an association between two groups of data, a dictionary is likely what you want to ... Read more

My Personal Top Five Foundational Python Books

Hello, readers, To write a good book, one important and time-consuming process is to read many good books. Prior to writing Learn to Code by Solving Problems, I had read dozens of Python programming books. Here are five of the best ones, including a mini review that I wrote for each one. My main criterion here was building a rock-solid Pytho... Read more

Can You Solve This Using Only Chapter 1?

Here’s a problem I recently gave my students. Can you solve it using only Chapter 1 of Learn to Code by Solving Problems? Fix Dan’s Sentences Dan’s writing a new book, but he needs a bit of help with his grammar. Correct the given sentences by adding commas in the correct locations throughout the sentence. Input A single line containing t... Read more

How to Handle the Practice Exercises

(Inspired by Jun tsuru, one of my readers.) Q: help! I’m getting my butt kicked by the practice problems in Learn to Code by Solving Problems. What do I do? A: first, you’re doing the right thing trying the practice problems. Reading alone is not enough. Second, repeat this to yourself three times: it is normal to struggle on practice problem... Read more

Input and Output Redirection in PowerShell

Hello! If you’re trying to use input redirection in Chapter 2 with PowerShell, you’ll need a different approach than the < operator that works in many other shells. Let’s say you wanted to use input redirection on the Telemarketers problem in Chapter 2. Here’s the command that I’m currently using for PowerShell for input redirection: Get-C... Read more