
File Handling in Python: Reading & Writing Files, Complete Teaching Bundle (Cambridge IGCSE 0478, AS & A Level 9618, OCR GCSE J277)
Teach students how programs store and retrieve data beyond a single run. This ready-to-use bundle covers opening, reading, writing, appending and closing text files in Python. It links each idea to the pseudocode used in exam questions, so students can move between the two with confidence.
What’s included
PowerPoint presentation: clear, step-by-step explanations with worked code examples and Python-to-pseudocode comparisons
Worksheet: graded tasks from basic read and write operations to short programs that process file data
Hands-on activity: a practical task where students build a program that saves and loads real data
MCQ quiz: quick questions for starters, plenaries or assessment
Full mark scheme: answers and explanations for every task, so marking is quick and consistent
Topics covered
Why programs use files, and the difference between a file and a variable
Opening files in read (“r”), write (“w”) and append (“a”) modes
Reading with .read(), .readline() and .readlines(), and looping through a file line by line
Writing and appending text with .write()
Closing files, and using with to do it safely
Processing file contents, such as splitting lines, converting data types and calculating totals
Handling errors, including FileNotFoundError and checking that a file exists
Linking Python file handling to exam pseudocode (OPENFILE, READFILE, WRITEFILE, CLOSEFILE)
Common mistakes, such as overwriting data in write mode
Why teachers like it
Zero prep: download and teach
Differentiated tasks that support all learners and stretch the more able
Written in Python and linked to exam pseudocode
Fully editable
Works for lessons, homework, revision and cover work
Suitable for
Teachers of Cambridge IGCSE Computer Science (0478), Cambridge AS & A Level Computer Science (9618) and OCR GCSE Computer Science (J277). It also works for any KS4/KS5 or beginner Python course. OCR A Level students will find it useful for NEA programming projects.
Please leave a review and follow my shop for more Computer Science resources!
Get this resource as part of a bundle and save up to 75%
A bundle is a package of resources grouped together to teach a particular topic, or a series of lessons, in one place.
Something went wrong, please try again later.
This resource hasn't been reviewed yet
To ensure quality for our reviews, only customers who have purchased this resource can review it
Report this resourceto let us know if it violates our terms and conditions.
Our customer service team will review your report and will be in touch.