File Handling Quiz 1

Here’s a set of 10 questions based on the topic “Introduction to files, types of files (Text file, Binary file, CSV file), relative and absolute paths”:

Introduction to files, types of files (Text file, Binary file, CSV file), relative and absolute paths

1. What is the primary purpose of using files in programming?

 
 
 
 

2. Which type of file contains human-readable text and can be opened with a text editor?

 
 
 
 

3. What is the main characteristic of a binary file?

 
 
 
 

4. In Python, how do you open a file for reading?

 
 
 
 

5. What is the purpose of the “wb” mode when opening a file in Python?

 
 
 
 

6. Which type of file is commonly used for storing tabular data, such as spreadsheets?

 
 
 
 

7. What does CSV stand for in the context of file formats?

 
 
 
 

8. What is the purpose of an absolute file path?

 
 
 
 

9. Which of the following is an example of a relative file path?

 
 
 
 

10. In Python, how can you close an open file?

 
 
 
 

Copywrite © 2020-2024, CBSE Python,
All Rights Reserved