Examplary
Start for free
Oak ComputingTest · Computing

Iterating through data structures

The starter and exit quiz of the lesson “Iterating through data structures”, from the unit “Python programming with sequences of data” (Year 9 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 the correct syntax in Python to initialise a variable called age and set its value to the numerical value 13?
  2. What is the correct syntax in Python to initialise a variable called name and set its value to Laura?
  3. Which programming construct is used to repeatedly perform actions in a program?
  4. ___ are used to tell a program whether a condition has been met or not.
  5. A while loop will run ...
  6. colours = ["red", "blue", "yellow", "green"]print (colours[1])What colour would be printed by the program?
  7. A ___ is a data type that is a collection of characters.
  8. Lists are ___, which means that their contents can be modified, without having to create a new list.
  9. Which code would check the first character of name1 does not appear anywhere in name2?
  10. Which of the following statements about strings is true?
  11. What code would you use if you wanted to check the value of the first letter held in the string: message = "Hello"?
  12. If you update the value held by a string, the previous value is ___.

License: OGL

Iterating through data structures · Examplary