Skip to main content

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.

ComputingKey Stage 3 / Year 7-9 (Ages 11-14)Codingintermediate
0 views
0 downloads

Exploring Coding Concepts

Key Stage 3 / Ages 11-14 / Intermediate Level

Name:
Date:
Score:
/8

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.

1

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

2

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 AInput BOutput (A AND B)
TrueTrue
TrueFalse
FalseTrue
FalseFalse

1. Fill in the truth table for A AND B.

3

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

4

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:

5

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:

6

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:

7

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:

___

8

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:

Answer Key

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

Want a customised worksheet?

Create your own AI-generated worksheet tailored to your exact needs.