HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-02-21
1 <p>When we're making a dish, we follow the recipe carefully. Otherwise, the food won't turn out as expected. The same rule applies to programming.</p>
1 <p>When we're making a dish, we follow the recipe carefully. Otherwise, the food won't turn out as expected. The same rule applies to programming.</p>
2 <p>We want to see the expected result onscreen, so we should give the computer clear, step-by-step directions. We can do it using instructions. An instruction is a command to the computer, a unit of execution. In this case, Python code is a set of instructions. We can present it as a step-by-step recipe.</p>
2 <p>We want to see the expected result onscreen, so we should give the computer clear, step-by-step directions. We can do it using instructions. An instruction is a command to the computer, a unit of execution. In this case, Python code is a set of instructions. We can present it as a step-by-step recipe.</p>
3 <p>We run the Python code using an<strong>interpreter</strong>, a program that executes instructions strictly one at a time. Like the steps in a recipe, the instructions for the interpreter are written in order and separated by jumping to the following line.</p>
3 <p>We run the Python code using an<strong>interpreter</strong>, a program that executes instructions strictly one at a time. Like the steps in a recipe, the instructions for the interpreter are written in order and separated by jumping to the following line.</p>
4 <p>Developers must understand the order of operations in the code and be able to mentally break the program into independent parts that are convenient for analysis.</p>
4 <p>Developers must understand the order of operations in the code and be able to mentally break the program into independent parts that are convenient for analysis.</p>
5 <p>Let's look at an example of some code with two instructions. When it's started, two sentences are displayed sequentially on the screen:</p>
5 <p>Let's look at an example of some code with two instructions. When it's started, two sentences are displayed sequentially on the screen:</p>
6 <p>We said above that instructions are separated from each other by a line break. But there is another way: you can separate them with a semicolon:</p>
6 <p>We said above that instructions are separated from each other by a line break. But there is another way: you can separate them with a semicolon:</p>
7 <p>There is no technical difference between the first and second versions. The interpreter will understand the instructions the same way, but it is physically inconvenient to read the second version.</p>
7 <p>There is no technical difference between the first and second versions. The interpreter will understand the instructions the same way, but it is physically inconvenient to read the second version.</p>
8 <p>It is better to place the instructions under each other. It makes it easier for colleagues to read your code, maintain it, and make changes.</p>
8 <p>It is better to place the instructions under each other. It makes it easier for colleagues to read your code, maintain it, and make changes.</p>