Examplary
Start for free
Oak ComputingTest · Computing

Dictionary challenge

The starter and exit quiz of the lesson “Dictionary challenge”, from the unit “Programming: dictionaries and data files” (Year 11 Computing) by Oak National Academy.

Free to use. Edit it, share it and hand it out to your students.

Oak National Academy

12 questions

  1. What is a dictionary used for in Python?
  2. In a Python dictionary, each item is made up of a ___ and a value.
  3. Which of these is a valid Python dictionary?
  4. What will this code output? my_dict = {"a": 1, "b": 2}print(my_dict["b"])
  5. Dictionary keys must be ...
  6. What will this code do?my_dict = {"cat": "meow", "dog": "bark"}my_dict["dog"] = "woof"
  7. What type of data structure is used to store key-value pairs in Python?
  8. Match the keyword to the definition.
  9. A Caesar cipher with key +2 will change A to ...
  10. What will be the output of this code?caesar = {"Y": "A", "Z": "B", "A": "C"} print(caesar["Z"])
  11. To add a new key-value pair to a dictionary, you can use the ___ operator.
  12. What does this line return?chr(66)

License: OGL

Dictionary challenge · Examplary