File Handling (OCR GCSE Computer Science): Quizzes
📚Quizzes
Practise the questions
11 questions from this quiz
ShowHide
Practise the questions
11 questions from this quiz
What are the four key file operations in file handling?
What are the four key file operations in file handling?
Open, read, write, close
What must be done before reading from or writing to a file?
What must be done before reading from or writing to a file?
The file must be opened
Which mode adds data to an existing file?
Which mode adds data to an existing file?
Append mode
What does reading a file mean?
What does reading a file mean?
Extracting data from it
How are files typically read?
How are files typically read?
Line by line or in chunks
What happens to existing file contents when opened in write mode?
What happens to existing file contents when opened in write mode?
May be overwritten
Why must a file be closed after reading or writing?
Why must a file be closed after reading or writing?
To free up system resources
What does closing a file ensure?
What does closing a file ensure?
All data is properly saved
In Python, what does open("file.txt", "r") do?
In Python, what does open("file.txt", "r") do?
Opens a file for reading
In Python, what does open("file.txt", "w") do?
In Python, what does open("file.txt", "w") do?
Opens a file for writing
What command closes a file in Python?
What command closes a file in Python?
file.close()
