CUET-UG SERIES Computer-science
File Handling
4 previous year questions.
Volume: 4 Ques
Yield: Medium
High-Yield Trend
1
2025 2
2024 1
2023 Chapter Questions 4 MCQs
01
PYQ 2023
medium
computer-science ID: cuet-ug-
1
A and D only
2
B and C only
3
C and E only
4
B and D only
02
PYQ 2024
medium
computer-science ID: cuet-ug-
Arrange the following in correct order of exception handling in python:
(A) Write the code that may raise an exception inside a try block
(B) Execute some code regardless of whether the exception occurs or not using the finally block
(C) Handle the specific exception using the except block
(D) Raise the exception using the raise statement if necessary
Choose the correct answer from the options given below:
1
(A), (B), (C), (D)
2
(A), (C), (B), (D)
3
(B), (A), (D), (C)
4
(C), (B), (D), (A)
03
PYQ 2024
medium
computer-science ID: cuet-ug-
Match List-I with List-II:
| List-I | List-II |
| (A) f.seek(-10,1) | (I) From beginning of file, move 10 bytes forward |
| (B) f.seek(10,1) | (II) From current position, move 10 bytes backward |
| (C) f.seek(10) | (III) From current position, move 10 bytes forward |
| (D) f.seek(-10,2) | (IV) From end of the file, move 10 bytes backward |
1
(A) - (I), (B) - (II), (C) - (III), (D) - (IV)
2
(A) - (II), (B) - (III), (C) - (IV), (D) - (I)
3
(A) - (III), (B) - (II), (C) - (IV), (D) - (I)
4
(A) - (II), (B) - (III), (C) - (I), (D) - (IV)
04
PYQ 2025
medium
computer-science ID: cuet-ug-
Sequence the steps to append data to an existing file and then read the entire file:
(A) Open the file in a+ mode.
(B) Use the read() method to output the contents.
(C) Use the write() or writelines() method to append data.
(D) Seek to the beginning of the file.
(A) Open the file in a+ mode.
(B) Use the read() method to output the contents.
(C) Use the write() or writelines() method to append data.
(D) Seek to the beginning of the file.
1
(A), (C), (D), (B)
2
(A), (B), (C), (D)
3
(B), (A), (C), (D)
4
(C), (B), (D), (A)