Coding Worksheet - KS3 - Intermediate
Coding worksheet for Key Stage 3 / Year 7-9 (Ages 11-14). Intermediate level computing practice, aligned to the UK National Curriculum. Print-ready with answer key included.
Exploring Coding Concepts
Key Stage 3 / Ages 11-14 / Intermediate Level
Instructions: This worksheet will guide you through various coding concepts, including data types, logic, and algorithms. Each activity is designed to enhance your understanding and problem-solving skills in computing.
Understanding Data Types
Identify the data type for each of the following variables. Write 'integer', 'string', 'float', or 'Boolean' in the box provided.
1. age = 15
2. name = 'Alice'
3. price = 19.99
4. is_student = True
Logic Gates and Truth Tables
Complete the truth table for the given logic gate expressions. Fill in the correct Boolean values (True/False) in the boxes.
| Input A | Input B | Output (A AND B) |
| True | True | |
| True | False | |
| False | True | |
| False | False |
1. Fill in the truth table for A AND B.
Binary to Denary Conversion
Convert the following binary numbers to denary (decimal) format. Show your working and write the final answer in the box.
1. 1011
2. 11001
3. 100101
Basic Python Program
Write a simple Python program that prints 'Hello, World!' to the console. Use the box to write your code.
Write your Python code here:
Algorithm Analysis
Consider the following algorithm written in pseudocode. Identify the type of loop used and explain its purpose.
Pseudocode:
FOR i = 1 TO 10
PRINT i
END FOR
1. Type of loop:
2. Purpose of the loop:
File Handling in Python
Describe the steps to open a file, read its contents, and close it in Python. Use the box to outline the steps clearly.
Outline the steps for file handling:
Selection Statements
Complete the following Python if-else statement to check if a number is positive, negative, or zero. Write your code in the box.
number = int(input('Enter a number: '))
if number > 0:
print('Positive')
else:
___
Understanding Variables and Constants
Explain the difference between a variable and a constant in programming. Provide an example of each in the box.
Explanation and examples:
Activity 1: integer ; string ; float ; Boolean
Activity 2: True ; False ; False ; False
Activity 3: 11 ; 25 ; 37
Activity 4: print('Hello, World!')
Activity 5: For loop ; To print numbers 1 to 10
Activity 6: open(), read(), close()
Activity 7: elif number < 0: print('Negative') else: print('Zero')
Activity 8: Variable can change value; constant remains the same
📚 Great books for Computing
Handpicked books to support learning at home · Amazon affiliate links

CGP KS2 Study Skills Book
How to learn effectively - revision tips and techniques
Usually ships in 24hrs

Scholastic Study Diary & Homework Planner
Helps children stay organised with homework and revision
Usually ships in 24hrs

Handwriting Practice Pad - Ages 5–7
Letter formation and joined-up writing practice
Usually ships in 24hrs

Staedtler Colouring Pencils 24 Pack
Quality pencils great for completing and illustrating worksheets
Usually ships in 24hrs