← QCE Digital Solutions Unit 1

The five basic features of programming

Every program is built from five features: variables, control structures, data structures, syntax, and libraries and classes.

Understanding The five basic features of programming in QCE Digital Solutions Unit 1

What it does: A for loop is a control structure because it repeats code, controlling the flow of the program. A list holds many values together, which makes it a data structure. The five features are variables, control structures, data structures, syntax, and libraries and classes. Every program is built from them. score = 10 stores a value under a name, which is a variable. import random brings in a library. Syntax is the set of rules for writing code, such as colons, brackets and keywords. A named storage place is a variable. A variable must be assigned a value before the program uses it. Put total = 10 on the first line.

Common mistakes: The variable is misspelled as scor, which was never created, so Python raises a NameError. It should be score = score + 10. A control structure like if needs a colon at the end of its line (syntax). It should be if age >= 16:.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 82–148) and word search (Modules 82–380).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which list correctly names the five basic features of programming?
Variables, control structures, data structures, syntax, libraries and classesVariables, flowcharts, pixels, syntax, hardware
Matches
if score > 50 print("Pass")
↓
Syntax error: the if line is missing its colon at the end. Syntax is the set of rules the code must follow.
Applying
Meanings
Term
five features of programming
Meaning
Every program is built from five features: variables, control structures, data structures, syntax, and libraries and classes.
Practice
import math
Testing
Gaps
print()
Check Answer
Spots
1score = 0
2score = scor + 10

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Octopus' badge — Multi-Tasker, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which list correctly names the five basic features of programming?
A. Variables, flowcharts, pixels, syntax, hardware
B. Variables, control structures, data structures, syntax, libraries and classes ✓
The five features are variables, control structures, data structures, syntax, and libraries and classes. Every program is built from them.
2. Which line of Python uses a VARIABLE?
A. import random
B. score = 10 ✓
score = 10 stores a value under a name, which is a variable. import random brings in a library.
3. Which code is a CONTROL STRUCTURE?
A. for i in range(5): ✓
B. names = ['Ava', 'Liam']
A for loop controls how the program flows by repeating steps. The list is a data structure.
4. Which code is a DATA STRUCTURE?
A. marks = [88, 74, 95] ✓
B. if marks > 50:
A list holds a collection of values, so it is a data structure. The if statement is a control structure.
5. Which statement describes SYNTAX in programming?
A. The rules for how code must be written so the computer can read it ✓
B. A named place that stores a value
Syntax is the set of rules for writing code, such as colons, brackets and keywords. A named storage place is a variable.

Match the Pairs

score = 0 → A variable: a named place that stores a value the program can use and change
import random → A library: ready-made code that is brought into the program so you can reuse it
A control structure decides which code runs or how many times it repeats → for i in range(5): print(i)
A data structure stores a collection of related values under one name → scores = [88, 74, 91]
if score > 50 print("Pass") → Syntax error: the if line is missing its colon at the end. Syntax is the set of rules the code must follow.
print(total) total = 10 → The variable total is used before it has been given a value, so Python cannot find it.

Key Term

five features of programming
Every program is built from five features: variables, control structures, data structures, syntax, and libraries and classes.

Fill in the Blanks

1. score = 10 print(score)
Hint: Type the name of the variable created on the first line so its stored value is printed.
2. lives = 3 while lives > 0: lives = lives - 1
Hint: Type the control structure keyword that repeats the indented block while a condition is true.
3. names = ["Ava", "Liam", "Mia"] print(names[0])
Hint: Type the index number of the first item in this list data structure.
4. age = 16 if age == 16: print("Year 11")
Hint: Type the syntax operator that checks whether two values are equal, not the one that assigns.
5. import random print(random.randint(1, 6))
Hint: Type the name of the library module that the second line uses to roll a die.

Spot the Error

Question 1
A score = 0
B score = scor + 10
C print(score)
Line B — The variable is misspelled as scor, which was never created, so Python raises a NameError. It should be score = score + 10.
Question 2
A age = 16
B if age >= 16
C print('Can drive')
Line B — A control structure like if needs a colon at the end of its line (syntax). It should be if age >= 16:
Question 3
A colours = ['red', 'blue']
B colours.append('green')
C print(colours[3])
Line C — The list has 3 items, so the valid indexes are 0, 1 and 2. Index 3 causes an IndexError. It should be colours[2].
Question 4
A import random
B n = randint(1, 6)
C print(n)
Line B — With import random, the function must be called through the library name. It should be random.randint(1, 6).
Question 5
A class Dog:
B def __init__(self, name):
C name = name
D pet = Dog('Rex')
Line C — This only changes a local variable, so the object never stores the name. It should be self.name = name.

Student with a class code? Join your class →