A good habit is to describe an algorithm before coding it, in a form that does not depend on language syntax. In this topic we learn two tools: pseudocode and flowcharts.
Why describe before coding
Code is full of syntax details: colons, indexes, types. Pseudocode is a description written for humans but shaped like a program; there is no single standard, what matters is that the steps are precise and unambiguous. A flowchart is a graphical record of the same algorithm: branches and loops are visible at a glance.