Here’s a 15-question “CSV File Quiz Class 12” based on the topics “CSV file: import csv module, open/close CSV file, write into a CSV file using writer(), writerow(), writerows() and read from a CSV file using reader(), Data Structure: Stack, operations on a stack (push & pop), implementation of a stack using a list”

CSV File Quiz Class 12

1. How do you import the csv module in Python?

 
 
 
 

2. Which method of the csv module is used to write into a CSV file row by row?

 
 
 
 

3. In the context of CSV files, what does the reader() method do?

 
 
 
 

4. What operation does the writerow() method of the csv module perform?

 
 
 
 

5. How can you open a CSV file for writing in Python?

 
 
 
 

6. What is the primary purpose of a stack data structure?

 
 
 
 

7. Which operation is used to add an element to a stack?

 
 
 
 

8. 8. In a stack, what does the “pop” operation involve?

 
 
 
 

9. How is a stack implemented using a list in Python?

 
 
 
 

10. What happens when you pop an element from an empty stack?

 
 
 
 

11. In a stack, what is the purpose of the “peek” operation?

 
 
 
 

12. What is the time complexity of the “push” and “pop” operations in a stack implemented using a list?

 
 
 
 

13. Which of the following is an application of a stack data structure?

 
 
 
 

14. How can you clear all elements from a stack in Python?

 
 
 
 

15. What does the “is_empty” method check in a stack?

 
 
 
 

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