teach-ict.com logo

THE education site for computer science and ICT

1. Introduction

At the most basic level 'computational thinking' includes breaking down a problem into smaller tasks. If a particular task is still complicated then that too is further broken into sub-tasks. This is called 'decomposition'. We have a complete section on it here.

This approach can be applied to anything in life for example, planning a shopping trip, choosing a new computer, deciding to move house etc. However, this syllabus is about computer science, and so we need to apply computational thinking to actual programming.

This section will describe the main methods we have available to break down a programming problem. These include:

  • Functions and subroutines
  • Iteration loops
  • Program modules

Another important feature is the ability to control how visible a variable is within the software. This is called the 'scope' of the variable.

We shall use Python examples to demonstrate how this is done. The Python code is also available as a zip file on the last page so you can run the demo code on your own computer.

 

image