Class 12 Computer Science Practice Set: File Handling
Review targeted practice sets for Class 12 Computer Science File Handling. Built according to official educational guidelines for the 2026-27 academic year, these downloadable worksheets support daily revision and core concept reinforcement.
Download File Handling Worksheet PDF
View or download the dedicated File Handling practice resource below. Engaging with these objective and subjective questions daily ensures continuous academic progress and mastery of the 2026-27 curriculum.
Question. Which function is used to change the position of the File Handle to a given specific position.
a) seek()
b) read()
c) tail()
d) write()
Answer : A
Question. How do you change the file position to an offset value from the start?
a) fp.seek(offset, 0)
b) fp.seek(offset, 1)
c) fp.seek(offset, 2)
d) none of the mentioned
Answer : A
Question. Which is the correct statement with respect of seek() function?
a) 0: sets the reference point at the beginning of the file
b) 1: sets the reference point at the current file position
c) 2: sets the reference point at the end of the file
d) All of these
Answer : D
Question. Which of the following statements correctly explain the function of seek() method?
a) tell the current position within the file.
b) indicate that the next read or write occurs from that position in a file.
c) determine if you can move the file position or not.
d) move the current file position to a different location at a defined offset.
Answer : D
Question. What does the <readlines()> method returns?
a) str
b) a list of lines
c) list of single characters
d) list of integers
Answer : B
Question. Which of the following functions can be used to check if a file “logo” exists?
a) os.path.isFile(logo)
b) os.path.exists(logo)
c) os.path.isfile(logo)
d) os.isFile(logo)
Answer : C
Question. Seek() function with negative offset only works when file is opened in ——– mode.
a) read mode
b) write mode
c) binary mode
d) All of these
Answer : C
Question. What happens if no arguments are passed to the seek function?
a) file position is set to the start of file
b) file position is set to the end of file
c) file position remains unchanged
d) error
Answer : D
Question. What is the use of seek() method in files()?
a) sets the file’s current position at the offset
b) sets the file’s previous position at the offset
c) sets the file’s current position within the file
d) none of the mentioned
Answer : A
Question. To read the next line of the file from a file object fobj, we use:
a) fobj.read(2)
b) fobj.read()
c) fobj.readline()
d) fobj.readlines()
Answer : C
Question. Which of the following commands can be used to read “n” number of characters from a file using the file object <file>?
a) file.read(n)
b) n = file.read()
c) file.readline(n)
d) file.readlines()
Answer : A
Question. What is the use of seek() method in files?
a) sets the file‟s current position at the offset
b) sets the file‟s previous position at the offset
c) sets the file‟s current position within the file
d) none of the mentioned
Answer : A
Question. Which of the following statements correctly explain the function of tell() method?
a) tells the current position within the file.
b) indicates that the next read or write will occur at that many bytes from the beginning of the file.
c) move the current file position to a different location.
d) it changes the file position only if allowed to do so else returns an error.
Answer : A, B
Question. Which of the following command is used to open a file “c:\temp.txt” in append-mode?
a) outfile = open(“c:/temp.txt”, “a”)
b) outfile = open(“c:\\temp.txt”, “rw”)
c) outfile = open(“c:\temp.txt”, “w+”)
d) outfile = open(“c:\\temp.txt”, “r+”)
Answer : A
Question. How do you get the current position within the file?
a) fp.seek()
b) fp.tell()
c) fp.loc
d) fp.pos
Answer : B
Question. Which of the following command is used to open a file “c:\temp.txt” in read-mode only?
a) infile = open(“c:\temp.txt”, “r”)
b) infile = open(“c:\\temp.txt”, “r”)
c) infile = open(file = “c:\temp.txt”, “r+”)
d) infile = open(file = “c:\\temp.txt”, “r+”)
Answer : B
Question. If we open the file in read mode then the initial value of tell() is
a) -1
b) 0
c) 1
d) End of the file
Answer : A
Question. What happens if no arguments are passed to the seek function?
a) file position is set to the start of file
b) file position is set to the end of file
c) file position remains unchanged
d) error
Answer : D
Please click on below link to download CBSE Class 12 Computer Science File Handling Worksheet Set B
Free study material for Computer Science
Download CBSE Practice Material: Class 12 Computer Science File Handling
Download Practice Sheet: File Handling (Class 12 Computer Science)
Access structured practice worksheets for File Handling designed in alignment with the latest CBSE curriculum for Class 12 Computer Science. These printable problem sets help students build accuracy and prepare effectively for school tests.
Concept Clarification for File Handling
Cross-reference your completed exercises with comprehensive NCERT solutions for Class 12 Computer Science to ensure absolute clarity across all sub-topics in this chapter.
Additional Study Resources for Class 12 Computer Science
Explore our broader library of printable assignments, chapter notes, and mock tests designed to support continuous revision and secure higher marks in CBSE assessments.
FAQs
You can download the teacher-verified PDF for CBSE Class 12 Computer Science File Handling Worksheet Set 02 from StudiesToday.com. These practice sheets for Class 12 Computer Science are designed as per the latest CBSE academic session.
Yes, our CBSE Class 12 Computer Science File Handling Worksheet Set 02 includes a variety of questions like Case-based studies, Assertion-Reasoning, and MCQs as per the 50% competency-based weightage in the latest curriculum for Class 12.
Yes, we have provided detailed solutions for CBSE Class 12 Computer Science File Handling Worksheet Set 02 to help Class 12 and follow the official CBSE marking scheme.
Daily practice with these Computer Science worksheets helps in identifying understanding gaps. It also improves question solving speed and ensures that Class 12 students get more marks in CBSE exams.
All our Class 12 Computer Science practice test papers and worksheets are available for free download in mobile-friendly PDF format. You can access CBSE Class 12 Computer Science File Handling Worksheet Set 02 without any registration.