Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can create a record using a dictionary in Python.

      Key learning points

      1. Data structures are used to store data in an organised and accessible way.
      2. A record is an example of a data structure.
      3. A record allows you to store a collection of attributes for a single entity.
      4. Python does not have a native data structure for a record.
      5. Instead, you can use a different data structure called a dictionary to represent a record.

      Keywords

      • Record - a collection of attributes for a single entity

      • Entity - an entity is a single object, place, person or thing

      • Attribute - properties or characteristics of an entity

      • Dictionary - a data structure that involves creating data pairings that can be located using a key

      • Key - used to identify each attribute held in the dictionary

      Common misconception

      There is no way to store multiple records in one data structure in Python.

      If you want to use multiple records in a database, then you can add multiple dictionaries to a list.

      Teacher tip

      There is a lot of new terminology in this lesson that learners may not be familiar with. Ensure learners are confident with the meaning of each keyword as you progress through the lesson. Consistent and accurate use of terminology will help pupils gain confidence of their correct usage.

      Equipment

      Pupils will need access to a device that can edit and run Python programs. Examples in this lesson use the RPF Code Editor https://oak.link/python-editor

      Licence

      This content is © Oak National Academy Limited (2026), 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

      6 Questions

      Q1.
      Which of the following correctly defines a list in Python?

      {1, 2, 3, 4}
      (1, 2, 3, 4)
      Correct answer: `["apple", "banana", "cherry"]`
      "apple", "banana", "cherry"

      Q2.
      Match the list operation with its description.

      Correct Answer:`append()`,adds an item to the end of a list

      adds an item to the end of a list

      Correct Answer:`pop()`,removes an item from a list

      removes an item from a list

      Correct Answer:`len()`,returns the number of items in a list

      returns the number of items in a list

      Q3.
      What will be the output of the following code?
      123
      fruits = ["apple", "banana", "cherry"] fruits.append("orange") print(fruits)
      Code colour

      ["apple", "banana", "cherry"]
      ["orange", "apple", "banana", "cherry"]
      Correct answer: `["apple", "banana", "cherry", "orange"]`
      ["orange", "apple", "banana", "cherry"]

      Q4.
      What does the .upper() method do in Python?

      Correct answer: converts all letters in a string to uppercase
      converts all letters in a string to lowercase
      removes spaces from a string
      reverses the string

      Q5.
      What will be the output of the following code?
      12
      word = "PYTHON" print(word[2])
      Code colour

      P
      Y
      Correct answer: T
      H
      O

      Q6.
      Strings can hold letters, numbers, and symbols, and they must be enclosed in .

      Correct Answer: quotes, "", speech marks, "

      6 Questions

      Q1.
      What is a record in programming?

      a single piece of data
      Correct answer: a collection of attributes for a single entity
      a type of loop in Python
      a function that modifies dictionaries

      Q2.
      What is an attribute in a record?

      Correct answer: a property or characteristic of an entity
      a type of variable in Python
      a function that retrieves data
      a key used to access lists

      Q3.
      What will be the output of the following code?
      12
      player = { "username" : "rockstar", "password" : "6goatsEating", "score" : 5328 } print(player["username"])
      Code colour

      Correct answer: rockstar
      6goatsEating
      5328
      username

      Q4.
      Match the keyword to the description.

      Correct Answer:record,a collection of attributes for a single entity

      a collection of attributes for a single entity

      Correct Answer:entity,a single object, place, person or thing

      a single object, place, person or thing

      Correct Answer:attribute,properties or characteristics of an entity

      properties or characteristics of an entity

      Correct Answer:dictionary,a data structure that involves creating data pairings

      a data structure that involves creating data pairings

      Correct Answer:key,used to identify each attribute held in the dictionary

      used to identify each attribute held in the dictionary

      Q5.
      How is a record typically represented in Python?

      using a list
      using a tuple
      Correct answer: using a dictionary
      using a function

      Q6.
      How can you modify a value in a dictionary?

      Correct answer: by reassigning a value using the key, e.g. `player["score"] = 9000`
      by using the append() function
      by using the update() function only
      dictionaries cannot be modified

      To help you plan your 11 computer science lesson on: Records and dictionaries, download all teaching resources for free and adapt to suit your pupils' needs...