Back to Constructs

Oak National Academy

Lessons written by expert teachers in England, each with slides, a video and quizzes.

Their topic:
Introduction to Python programming · Using fundamental programming constructs in a block-based language
For your topic:
Constructs · Computer Science - 4CP0

Use these lessons alongside our lesson note, which covers your syllabus in full.

What this covers in your syllabus

3 lessons from Oak National Academy

Lesson 1 of 3 · Lower secondary, ages 11 to 14

Building a program using control structures

By the end: I can combine sequence, selection and iteration to build a program that uses complex conditions.

Key learning points

  1. Expressions formed using logical operators evaluate to either True or False.
  2. Logical and relational operators can be combined to create complex conditions.
  3. The programming constructs of sequence, selection and iteration can be combined to make more complex programs.

Keywords

condition
an expression that evaluates to True or False
selection
used when there is more than one possible path for a program to follow
iteration
the process of repeating a sequence of instructions within a program loop

A common mistake

Mistake: Learners often get confused between the logic operators AND and OR.

In fact: For an AND statement to return True both inputs must be True. For an OR statement to return True either input can be True.

Check what you learned

From Oak National Academy's exit quiz. Choose every answer that is right.

Which logical operator in Python would you use to check if at least one of two conditions is True?
Which logical operator in Python would you use to check if both of two conditions are True?
Which of these Python `while` loop conditions will keep the loop running forever, no matter what happens inside the loop?
Which of the following is a potential benefit of combining programming structures?
What is the output of the following Python code? ``` is_weekend = True have_homework = False if is_weekend and not have_homework: print("Time to relax") else: print("Time to study.")```

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

Lesson 2 of 3 · Lower secondary, ages 11 to 14

Problem solving using programming constructs

By the end: I can combine sequence, selection and iteration in a program to solve a problem.

Take the full lesson on Oak National Academy The video, slides and quizzes for this lesson are on Oak National Academy's site.

Key learning points

  1. The programming constructs of sequence, selection and iteration can be combined to make more complex programs.
  2. Analysing a problem involves decomposing it into its constituent parts.
  3. Algorithms can be developed to solve a problem.
  4. A problem can be solved in multiple ways.

Keywords

problem
a situation or task that needs to be solved
decomposition
breaking down a problem into smaller parts to make the task more manageable
solution
a means of solving a problem

A common mistake

Mistake: Programming constructs cannot be combined in the same code block.

In fact: The programming constructs of sequence, selection and iteration can be combined within the same code block to make more complex programs.

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

Lesson 3 of 3 · Lower secondary, ages 11 to 14

Sequence

By the end: I can use subroutines to execute sequences of commands.

Take the full lesson on Oak National Academy The video, slides and quizzes for this lesson are on Oak National Academy's site.

Key learning points

  1. Computers only follow the commands they are given, so these need to be precise and accurate.
  2. Commands can be joined together to create sequences in Scratch to achieve a desired outcome.
  3. Sequences can be separated into individual subroutines.
  4. Programs should be written so that other people can easily understand them. Subroutines are used to do this.

Keywords

execute
to run or carry out the commands in a program
sequence
the order of commands in a program
subroutine
a sequence of instructions with an identifiable name that performs a specific task

A common mistake

Mistake: A sprite in Scratch can only have one sequence of code blocks.

In fact: Sequences of code can be separated into subroutines and these subroutines can be called multiple times.

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

The wording comes from each publisher. The layout and the links to your syllabus are ours.