What an Algorithm Actually Is

The word sounds academic. The idea is not.

An algorithm is a procedure for solving a problem. A recipe is an algorithm. Long division is an algorithm. The steps your grandmother used to divide a pot of food evenly among nine people is an algorithm.

You have written dozens already. Every loop that counted, filtered, or totaled something was an algorithm with a name you had not learned yet.

✦ Three layers, again

The same distinction from Module 1 carries you through all of Level IV. The PROBLEM is what you need. The ALGORITHM is the sequence of steps that solves it. The SYNTAX is how one language writes those steps down. Algorithms transfer between languages perfectly, because they are pure thinking.

The professional habit is to solve the problem in plain English first, then in pseudocode, and only then in a language. Skipping to code is how people get stuck.

EXAMPLE
loading editor…
YOUR TURN
Your turn → Write the plain-English plan for finding the smallest number as comments first, then write the code under each comment.
loading editor…

Syntax has to be exact. Every quote, bracket and parenthesis needs its partner, and in Python the spaces at the start of a line count. One slip and the program won't run; the message will say where.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Breaking Problems Down →
← Back