This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 1: Introduction

Recap

face Josiah Wang

So far, you have explored the basic programming ‘atoms’ in Python (variables, identifiers, data types, objects).

You write programs by forming larger building blocks from these basic ‘atoms’, through a composition of these atoms to form larger constructs like expressions and statements.

Programs are formed from a composition of basic elements

We explored the selection building block in more detail, and introduced a multi-way variant with if-elif-else.

The multi-way selection block

You have also looked at calling functions, and how such named constructs (along with variables) allows for a higher level of abstraction, making it easier to write and understand your programs. You have also imported modules to enable you to use many more functions beyond Python’s built-in functions.

A function call

I have also advised you to almost write useful comments to your code, and to always test your program as you code.

You have also committed files to your Git repository for your robot project. This is something that you should be doing often, and will hopefully be second nature to you soon!