New
New
Year 10
OCR

Arrays and lists

I can describe the differences between lists and arrays and use a list in a program.

New
New
Year 10
OCR

Arrays and lists

I can describe the differences between lists and arrays and use a list in a program.

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

These resources were created for remote use during the pandemic and are not designed for classroom teaching.

Lesson details

Key learning points

  1. Data structures are used to store data in an organised and accessible way.
  2. Data structures can be static or dynamic.
  3. Static data structures reserve memory locations for a set amount of data. Their size cannot change.
  4. Dynamic data structures are more flexible. The memory capacity is not fixed.

Keywords

  • Static - a data structure that has a fixed size in memory

  • Dynamic - a data structure that can grow or shrink to accommodate items

  • Array - a static data structure that contains items of the same data type

  • List - a dynamic data structure that can contain items of different data types

Common misconception

Arrays and lists behave in the same way.

An array has a predefined fixed size. A list can vary in size throughout program execution.


To help you plan your year 10 computer science lesson on: Arrays and lists, download all teaching resources for free and adapt to suit your pupils' needs...

Some exam boards do not require a differentiation between list and arrays. Make sure you are clear what is needed to be learnt for the exam specification you are teaching
Teacher tip

Equipment

All pupils require access to devices that can edit and run Python programs. Starter code files are available to copy or use directly via the Raspberry Pi Code Editor.

Licence

This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0 except where otherwise stated. See Oak's terms & conditions (Collection 2).

Lesson video

Loading...

Prior knowledge starter quiz

Download quiz pdf

6 Questions

Q1.
What will be the output of this program?
12
word = "MOONLIGHT" print(word.lower())
Code colour

When programmers write code, they use a special tool called an IDE (Integrated Development Environment). In an IDE, different colours are used to help programmers understand the code:


  • • Blue - numbers and boolean values
  • • Green - strings
  • • Purple - keywords

Correct answer: moonlight
MOONLIGHT
Moonlight
MoonLight

Q2.
What does the
random.choice()
function do?

creates a new random list
Correct answer: selects a random item from a list or string
removes a random item from a list
sorts a list in random order

Q3.
What will be the output of this program?
12
fruit = "Strawberry" print(fruit[5:10].upper())
Code colour

When programmers write code, they use a special tool called an IDE (Integrated Development Environment). In an IDE, different colours are used to help programmers understand the code:


  • • Blue - numbers and boolean values
  • • Green - strings
  • • Purple - keywords

strawBERRY
STRAWberry
Correct answer: BERRY
STRAW

Q4.
is a way of joining strings using the
+
operator to make a new string.

Correct Answer: Concatenation

Q5.
is the process of checking an input meets certain requirements.

Correct Answer: Validation

Q6.
What must be included in a Python program to use the random module?

insert random
use random
Correct answer: `import random`
from random import shuffle

Assessment exit quiz

Download quiz pdf

6 Questions

Q1.
Which of the following is true about arrays?

Arrays are dynamic data structures that allow adding and deleting items.
Arrays store items of different data types.
Correct answer: The size of an array is fixed, and items must all be of the same type.
Arrays can grow or shrink in size as needed.

Q2.
What is the correct way to create a list in Python?

planets = ("Mercury", "Venus", "Earth")
Correct answer: `planets = ["Mercury", "Venus", "Earth"]`
planets = {Mercury, Venus, Earth}
planets = "Mercury", "Venus", "Earth"

Q3.
In Python, the index of the first item in a list starts at .

Correct Answer: 0, zero

Q4.
Which of the following methods allows you to pick a random planet from the list planets?

random.select(planets)
Correct answer: `random.choice(planets)`
random.shuffle(planets)

Q5.
Lists are data structures, meaning they can have items added or removed and can store different data types in the same list.

Correct Answer: dynamic

Q6.
Arrays are data structures, meaning they cannot have items added or removed and they must contain items of the same data type.

Correct Answer: static