Text Files
A2 CS
Text files
Types
• Writing, reading, appending
EOF – end of file
VSC
• In VSC you need to create a folder as standalone python files don’t
work in some IDE’s
As you can see, I do not
have not run the python file
yet as it hasn’t created the
writing text file.
Creates the file and
inserts the content
Reading from the text file
Appending to a file
Paper 41 – June 2022
https://bestexamhelp.com/exam/cambridge-international-a-
level/computer-science-9618/2022/9618-s22-qp-41.php
• Take a look at Q1 by clicking on the link above. You will also find the
source file and the mark scheme.

Text files, Python. Pseudocode and Python examples for 9618 CS.

  • 1.
  • 2.
  • 3.
  • 4.
    EOF – endof file
  • 5.
    VSC • In VSCyou need to create a folder as standalone python files don’t work in some IDE’s As you can see, I do not have not run the python file yet as it hasn’t created the writing text file. Creates the file and inserts the content
  • 6.
  • 7.
  • 8.
    Paper 41 –June 2022 https://bestexamhelp.com/exam/cambridge-international-a- level/computer-science-9618/2022/9618-s22-qp-41.php • Take a look at Q1 by clicking on the link above. You will also find the source file and the mark scheme.