Chapter 1: Introduction

Recap

face Josiah Wang

Welcome back to Python Programming!

Lesson 1 has given you a big picture understanding of the concept of programming.

If you remember, programming is NOT just about coding. There is more to it than that.

I introduced three steps to programming:

  1. Understanding and formulating the problem
  2. Designing an algorithm to solve the problem
  3. Implementing the algorithm (i.e. coding)

The three steps to programming

An algorithm is like a recipe or instructions for your computer. The key point is that these instructions must be unambiguous and written in a specific way, unlike natural language.

I have also introduced you to how a compiler or interpreter translates your code into instructions the computer can understand and execute (what is the difference between a compiler and an interpreter?) Remember, your computer does not understand Python. It only understands machine languages. A high-level language like Python is for YOUR convenience, because writing low-level machine language is just WAY too tedious. Python automatically compiles your code into an intermediate bytecode, and interprets the bytecode into machine language.

I have also introduced to the process of developing an algorithm and implementing the algorithm in Python with a Guessing Game example. With this example, I introduced the three “basic building blocks” of programming: simple statements, selection, and repetition.

The three basic programming building blocks

When you have these three building blocks, you can write almost any programs! In fact, you should even be able to write any program with the first two, although with a large additional effort 😣