Back to Browse

File Handling Coding Challenge: Write, Read & Append | OCR J277

2 views
May 18, 2026
10:36

Welcome back to our OCR GCSE Computer Science (J277) revision series! Today, we are putting our programming knowledge to the test with a 5-question mock paper dedicated entirely to File Handling. Interactive Challenge: For each question on our custom worksheet, I want you to PAUSE the video, open up your Python editor, and try to write the algorithm yourself. Once you have given it a go, unpause the video to check your solution against the official exam board mark scheme! We will cover: - Q1 (3 Marks): Opening a file in write mode (`"w"`), writing a string, and cleanly closing it. - Q2 (3 Marks): Opening an existing file in read mode (`"r"`) and capturing the first line using `.readline()`. - Q3 (3 Marks): The safe way to add text to an existing file using append mode (`"a"`) without wiping your database. - Q4 (4 Marks): Combining file writing with a `FOR` loop to write a sequence of numbers on separate lines. - Q5 (5 Marks): Using a `WHILE` loop and checking for the End of File (EOF) to read and print an entire document line-by-line.

Download

0 formats

No download links available.

File Handling Coding Challenge: Write, Read & Append | OCR J277 | NatokHD