File Handling In Python
19 previous year questions.
High-Yield Trend
Chapter Questions 19 MCQs
| LIST I | LIST II |
|---|---|
| A. write lines | III. Writing a sequence of string |
| B. pickle | I. Module for binary files |
| C. try-except | IV. Exception handling |
| D. rb | II. Opening and reading a binary file |
A. The user can read the file in \textless a\textgreater\ mode.
B. If the file is opened in \textless a\textgreater\ mode and the file doesn’t exist, then it will create a new file.
C. The user can write at the end of existing file when file is opened in \textless a\textgreater\ mode.
D. \textless a\textgreater\ mode is the default mode.
E. If the file is opened in \textless a\textgreater\ mode, the file offset position returned in the End of the file.
Choose the correct answer from the options given below:
| List I | List II | ||
| A. | tell() | I. | This function used to position the file object at particular position in a file |
| B. | seek() | II. | This function returns an integer that specifies the current position of the object in the file |
| C. | dump() | III. | This function is used to convert Python objects for writing data in a binary file |
| D. | load() | IV. | This function is used to load data from a binary file |
Code:
(A) f.write(”CUET EXAMINATION”)
(B) f=open(”CUET.TXT”, ”w”)
(C) print(”Data is Written Successfully”)
(D) f.close()
Choose the correct answer from the options given below:
| List-I | List-II |
| (A) readline() | (I) Writes a sequence of strings to the file |
| (B) writelines() | (II) Reads a single line from the file |
| (C) seek() | (III) Force any buffered output to be written to the file |
| (D) flush() | (IV) Moves the file pointer to the specified position |
\hspace{0.5cm} print("Zero denominator not allowed")
(B) finally:
\hspace{0.5cm} print("Over and Out")
(C) try:
\hspace{0.5cm} n = 50
\hspace{0.5cm} d = int(input("enter denominator"))
\hspace{0.5cm} q = n/d
\hspace{0.5cm} print("division performed")
(D) else:
\hspace{0.5cm} print("Result=", q)
Given the following statement: import matplotlib.pyplot as plt 'plt' in the above statement is .............. name.
About File Handling In Python - CUET-UG
File Handling In Python is a vital chapter for CUET-UG aspirants. Mastering the concepts covered in this chapter is essential for securing a top rank.
By rigorously practicing the previous year questions associated with this chapter, you can identify high-yield topics, understand the examiner's perspective, and boost your confidence during the actual exam.
Frequently Asked Questions
Why focus on File Handling In Python PYQs?
Analyzing PYQs for this specific chapter reveals the most frequently tested concepts and the typical complexity of questions, allowing you to tailor your study plan efficiently.
How to best use this analysis?
Review the topic breakdown to see which sub-topics within File Handling In Python carry the most weight. Then, tackle the questions iteratively to solidify your understanding.