Examplary
Start for free
Oak ComputingTest · Computing

Reading text files

The starter and exit quiz of the lesson “Reading text files”, 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 type of brackets are used to define a dictionary in Python?
  2. What type of brackets are used to define a list in Python?
  3. What is an attribute in a record?
  4. List items are separated by ___ in Python.
  5. What will be the output of this code?player = { "username" : "rockstar", "password" : "6goatsEating", "score" : 5328 } print(player["score"])
  6. What will be the output of this code?my_list = [3, 6, 9, 12] my_list.append(15) print(my_list)
  7. The method used to remove extra spaces or new lines from the beginning and end of a string in Python is called ___.
  8. Opening a file in write (w) mode will...
  9. Which of the following correctly opens a file named "data.txt" in read mode?
  10. Once you have finished working with a file, you should always ___ it to free up system resources.
  11. Which method reads an entire file and returns it as a string?
  12. Using readline() will...

License: OGL

Reading text files · Examplary