
Learning Objectives
When you write lines of code, there are three ways you can control the order these lines will be executed by the computer:
- Sequencing: This means that the computer will run your code in order, one line at a time from the top to the bottom of your program. It will start at line 1, then execute line 2 then line 3 and so on till it reaches the last line of your program.
- Selection: Sometimes you only want some lines of code to be run only if a condition is met, otherwise you want the computer to ignore these lines and jump over them. This is achieved using IF statements. e.g. If a condition is met then lines 4, 5, 6 are executed otherwise the computer jumps to line 7 without even looking at line 4,5 and 6.
- Iteration: Sometimes you want the computer to execute the same lines of code several times. This is done using a loop. There are three types of loops: For loops, while loops and repeat until loops. That’s handy as it enables you not to have to copy the same lines of code many times.


Let’s Get Coding
For this task we are going to write a program that uses sequencing, selection and iteration all in the same program! Our program will be used to print our daily routines on screen over a full week. Look at the code below and try to make sense of how it works. Can you spot where and how sequencing, iteration and selection are used in this code?
Your Task
Your task is to tweak this code to customise your daily routines. Add to it some of the activities or clubs you go to. For instance:
- Are you going swimming on Tuesdays?
- Do you play football on Saturdays?
- Do you go to a Youth Club on Thursdays?
- Do you play music on Fridays?
- Is Friday Fish and Chips day?
Have you ever been in a sweet shop to buy sweets? For this challenge we are going to spend £5 in a sweet shop hence we need to find out how many sweets we can afford. We will want to pick and mix sweets until we have spent all our money.


A window cleaner uses the following pricing policy to calculate how much to charge for cleaning all the windows of his customer’s dwelling. This pricing policy is based on the number of windows that need to be cleaned and works as follows:
In this challenge we are going to create some animated gradients by progressively changing the colour of the screen from one colour (e.g. red) to another (e.g. yellow).
For this challenge we are going to use Python turtle to create some charts: Column charts, line charts and radar charts.


On this trinket widget the turtle screen is 400 pixels wide by 400 pixels high. So:
For this challenge you are going to write a computer program where the user tries to score a goal against the computer.












Look at the picture on the right. Can you give a unique name to each of the colours displayed on the picture? (e.g. Lemon yellow, sunset yellow, tangerine etc.)

