CBSE Class 12 Computer Science File Handling Worksheet Set B

Read and download free pdf of CBSE Class 12 Computer Science File Handling Worksheet Set B. Download printable Computer Science Class 12 Worksheets in pdf format, CBSE Class 12 Computer Science File Handling Worksheet has been prepared as per the latest syllabus and exam pattern issued by CBSE, NCERT and KVS. Also download free pdf Computer Science Class 12 Assignments and practice them daily to get better marks in tests and exams for Class 12. Free chapter wise worksheets with answers have been designed by Class 12 teachers as per latest examination pattern

File Handling Computer Science Worksheet for Class 12

Class 12 Computer Science students should refer to the following printable worksheet in Pdf in Class 12. This test paper with questions and solutions for Class 12 Computer Science will be very useful for tests and exams and help you to score better marks

Class 12 Computer Science File Handling Worksheet Pdf

 FILE HANDLING 
 
1. Fill in the blanks.
 
i. ..................... format is a text format, accessible to all applications across several platforms.
 
ii. ..................... method is used for random access of data in a CSV file.
 
iii. ..................... method of pickle module is used to write an object into binary file.
 
iv. ..................... method of pickle module is used to read data from a binary file.
 
v. ..................... is a string method that joins all values of each row with comma separator in CSV.
 
vi. ..................... object contains the number of the current line in a CSV file.
 
2. State whether the following statements are True or False.
 
i. The type of operation that can be performed on a file depends upon the file mode in which it is opened.
 
ii. Functions readline() and readlines() are essentially the same.
 
iii. Comma is the default delimiter for a CSV file.
 
iv. tell() method of Python tells us the current position within the file.
 
v. The offset argument to seek() method indicates the number of bytes to be moved.
 
vi. If the offset value is set to 2, beginning of the file would be taken as seek position.
 
3. Multiple Choice Questions (MCQs)
 
(a) Which of the following is not a valid mode to open a file?
 
(i) ab   (ii) rw   (iii) r+   (iv) w+
 
(b) Which statement is used to change the file position to an offset value from the start?
 
(i) fp.seek(offset, 0) (ii) fp.seek(offset, 1)
 
(iii) fp.seek(offset, 2) (iv) None of the above
 
(c) The difference between r+ and w+ modes is expressed as?
 
(i) No difference (ii) In r+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for w+
 
(iii) In w+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for r+
 
(iv) Depends on the operating system
 
(d) What does CSV stand for?
 
(i) Cursor Separated Variables    (ii) Comma Separated Values
 
(iii) Cursor Separated Values     (iv) Cursor Separated Version
 
(e) Which module is used for working with CSV files in Python?
 
(i) random   (ii) statistics   (iii) csv   (iv) math
 
(f) Which of the following modes is used for both writing and reading from a binary file?
 
(i) wb+    (ii) w    (iii) wb   (iv) w+
 
(g) Which statement is used to retrieve the current position within the file?
 
(i) fp.seek()   (ii) fp.tell()   (iii) fp.loc   (iv) fp.pos
 
(h) What happens if no arguments are passed to the seek() method?
 
(i) file position is set to the start of file
 
(ii) file position is set to the end of file
 
(iii) file position remains unchanged
 
(iv) results in an error
 
(i) Which of the following modes will refer to binary data?
 
(i) r   (ii) w   (iii) +   (iv) b
 
(j) Every record in a CSV file is stored in reader object in the form of a list using which method?
 
(i) writer()   (ii) append()   (iii) reader()   (iv) list()
 
4. Consider the following code:
 
f = open('test', 'w+')
f.write('0123456789abcdef')
f.close()
f=open('test','rb')
f.seek(-3,2) //Statement 1
print(f.read(2)) //Statement 2
f.close()
Explain statement 1 and give output of statement 2.
5. What is the output of the following code :
fh = open("test.txt", "r")
Size = len(fh.read())
print(fh.read(5))
 
6. Give the output of the following snippet:
 
import pickle
list1, list2 = [2, 3, 4, 5, 6, 7, 8, 9, 10], []
for i in list1:
if (i%2==0 and i%4==0):
list2.append(i)
f = open("bin.dat","wb")
pickle.dump(list2, f)
f.close()
f = open("bin.dat", "rb")
data = pickle.load(f)
f.close()
for i in data:
print(i)
 
7. Following is the structure of each record in a data file named as
 
”PRODUCT.DAT”.
{"prod_code":value, "prod_desc":value, "stock":value}
The values for prod_code and prod_desc are strings, and the value for stock is an integer. Write a function in PYTHON to update the file with a new value of stock.
The stock and the prod_code, whose stock is to be updated, are to be input during the execution of the function.
 
8. Given a binary file “STUDENT.DAT”, containing records of the following type:
 
[S_Admno, S_Name, Percentage]
Where these three values are:
S_Admno – Admission Number of student (string)
S_Name – Name of student (string)
Percentage – Marks percentage of student (float)
Write a function in PYTHON that would read contents of the file
“STUDENT.DAT” and display the details of those students whose percentage is above 75.
 
9. Assuming the tuple Vehicle as follows:
 
( vehicletype, no_of_wheels)
Where vehicletype is a string and no_of_wheels is an integer.
Write a function showfile() to read all the records present in an already existing binary file SPEED.DAT and display them on the screen, also count the number of records present in the file.
 
10. Write a function in PYTHON to search for a BookNo from a binary file
 
“BOOK.DAT”, assuming the binary file is containing the records of the following type:
{"BookNo":value, "Book_name":value}
Assume that BookNo is an integer.
 
11. Assuming that a binary file VINTAGE.DAT contains records of the following type [VNO, VDesc, price].
 
Write a function in PYTHON to read the data VINTAGE.DAT and display those vintage vehicles, which are priced between 200000 and 250000.
 
12. Write a function in PYTHON to delete a laptop from a binary file
“LAPTOP.DAT” containing the records of following type.
[ModelNo, RAM, HDD, Details]
where ModelNo, RAM, HDD are integers and Details is a string. The user should enter the model number and the function should delete the details of the laptop from the file.
 
13. Write a menu-driven program to perform all the basic operations using dictionary on student binary file such as
 
i. Inserting records
ii. Reading all records & displaying
iii. Updating record based on given roll number
iv. Searching record based on given marks
v. Deleting a record based on given name
Structure of student dictionary :
{“ ROLLNO”: roll,”NAME”:name,”MARKS”:marks}
 
14. What are the advantages of CSV file formats?
 
15. Write a menu-driven program implementing user-defined functions to perform different functions on a csv file “student” such as:
 
(a) Write a single record to csv
(b) Write all the records in one single go onto the csv.
(c) Display the contents of the csv file.


Please click on below link to download CBSE Class 12 Computer Science File Handling Worksheet Set B

Practice Worksheets Class 12 Computer Science
CBSE Class 12 Computer Science All Chapters Worksheet
CBSE Class 12 Computer Science Arrays Worksheet
CBSE Class 12 Computer Science Binary Files Worksheet
CBSE Class 12 Computer Science Boolean Algebra Worksheet
CBSE Class 12 Computer Science C++ Worksheet Set A
CBSE Class 12 Computer Science C++ Worksheet Set B
CBSE Class 12 Computer Science Classes And Objects Worksheet
CBSE Class 12 Computer Science Communication Technology Worksheet
CBSE Class 12 Computer Science Computer Networks Worksheet Set A
CBSE Class 12 Computer Science Computer Networks Worksheet Set B
CBSE Class 12 Computer Science Computer Networks Worksheet Set C
CBSE Class 12 Computer Science Constructor And Destructor Worksheet Set A
CBSE Class 12 Computer Science Constructor And Destructor Worksheet Set A
CBSE Class 12 Computer Science Constructor And Destructor Worksheet Set B
CBSE Class 12 Computer Science Data Base Concept Worksheet
CBSE Class 12 Computer Science Data File Handling Worksheet
CBSE Class 12 Computer Science Data Management Worksheet Set A
CBSE Class 12 Computer Science Data Management Worksheet Set B
CBSE Class 12 Computer Science Data Management Worksheet Set C
CBSE Class 12 Computer Science Data Management Worksheet Set D
CBSE Class 12 Computer Science Data Management Worksheet Set E
CBSE Class 12 Computer Science File Handling Worksheet Set A
CBSE Class 12 Computer Science File Handling Worksheet Set B
CBSE Class 12 Computer Science File Handling Worksheet Set C
CBSE Class 12 Computer Science Function In Python Program Worksheet
CBSE Class 12 Computer Science Functions Worksheet Set A
CBSE Class 12 Computer Science Functions Worksheet Set B
CBSE Class 12 Computer Science Header Files Worksheet
CBSE Class 12 Computer Science Implementation of Queue Worksheet Set A
CBSE Class 12 Computer Science Implementation of Queue Worksheet Set B
CBSE Class 12 Computer Science Implementation of Stack Worksheet
CBSE Class 12 Computer Science Inheritance Worksheet Set A
CBSE Class 12 Computer Science Inheritance Worksheet Set B
CBSE Class 12 Computer Science Pointers Worksheet
CBSE Class 12 Computer Science Programming and Computational Thinking Worksheet Set A
CBSE Class 12 Computer Science Programming and Computational Thinking Worksheet Set B
CBSE Class 12 Computer Science Programming and Computational Thinking Worksheet Set C
CBSE Class 12 Computer Science Programming and Computational Thinking Worksheet Set D
CBSE Class 12 Computer Science Programming and Computational Thinking Worksheet Set E
CBSE Class 12 Computer Science Programming and Computational Thinking Worksheet Set F
CBSE Class 12 Computer Science Python Worksheet
CBSE Class 12 Computer Science Recursion Worksheet
CBSE Class 12 Computer Science Revision Worksheet
CBSE Class 12 Computer Science Society Law and Ethics Worksheet Set A
CBSE Class 12 Computer Science Society Law and Ethics Worksheet Set B
CBSE Class 12 Computer Science Society Law and Ethics Worksheet Set C
CBSE Class 12 Computer Science Society Law and Ethics Worksheet Set D
CBSE Class 12 Computer Science Society Law and Ethics Worksheet Set E
CBSE Class 12 Computer Science Sql Worksheet Set A
CBSE Class 12 Computer Science Sql Worksheet Set B
CBSE Class 12 Computer Science Using Python Libraries Worksheet
CBSE Class 12 Computer Science Worksheet Set A Solved
CBSE Class 12 Computer Science Worksheet Set B Solved
CBSE Class 12 Computer Science Worksheet Set C Solved
CBSE Class 12 Computer Science Worksheet Set D Solved
CBSE Class 12 Computer Science Worksheet Set E Solved
CBSE Class 12 Computer Science Worksheet Set F Solved

More Study Material

CBSE Class 12 Computer Science File Handling Worksheet

The above practice worksheet for File Handling has been designed as per the current syllabus for Class 12 Computer Science released by CBSE. Students studying in Class 12 can easily download in Pdf format and practice the questions and answers given in the above practice worksheet for Class 12 Computer Science on a daily basis. All the latest practice worksheets with solutions have been developed for Computer Science by referring to the most important and regularly asked topics that the students should learn and practice to get better scores in their examinations. Studiestoday is the best portal for Printable Worksheets for Class 12 Computer Science students to get all the latest study material free of cost.

Worksheet for Computer Science CBSE Class 12 File Handling

Teachers of studiestoday have referred to the NCERT book for Class 12 Computer Science to develop the Computer Science Class 12 worksheet. If you download the practice worksheet for the above chapter daily, you will get better scores in Class 12 exams this year as you will have stronger concepts. Daily questions practice of Computer Science printable worksheet and its study material will help students to have a stronger understanding of all concepts and also make them experts on all scoring topics. You can easily download and save all revision Worksheets for Class 12 Computer Science also from www.studiestoday.com without paying anything in Pdf format. After solving the questions given in the practice sheet which have been developed as per the latest course books also refer to the NCERT solutions for Class 12 Computer Science designed by our teachers

File Handling worksheet Computer Science CBSE Class 12

All practice paper sheet given above for Class 12 Computer Science have been made as per the latest syllabus and books issued for the current academic year. The students of Class 12 can be assured that the answers have been also provided by our teachers for all test paper of Computer Science so that you are able to solve the problems and then compare your answers with the solutions provided by us. We have also provided a lot of MCQ questions for Class 12 Computer Science in the worksheet so that you can solve questions relating to all topics given in each chapter. All study material for Class 12 Computer Science students have been given on studiestoday.

File Handling CBSE Class 12 Computer Science Worksheet

Regular printable worksheet practice helps to gain more practice in solving questions to obtain a more comprehensive understanding of File Handling concepts. Practice worksheets play an important role in developing an understanding of File Handling in CBSE Class 12. Students can download and save or print all the printable worksheets, assignments, and practice sheets of the above chapter in Class 12 Computer Science in Pdf format from studiestoday. You can print or read them online on your computer or mobile or any other device. After solving these you should also refer to Class 12 Computer Science MCQ Test for the same chapter.

Worksheet for CBSE Computer Science Class 12 File Handling

CBSE Class 12 Computer Science best textbooks have been used for writing the problems given in the above worksheet. If you have tests coming up then you should revise all concepts relating to File Handling and then take out a print of the above practice sheet and attempt all problems. We have also provided a lot of other Worksheets for Class 12 Computer Science which you can use to further make yourself better in Computer Science

Where can I download latest CBSE Practice worksheets for Class 12 Computer Science File Handling

You can download the CBSE Practice worksheets for Class 12 Computer Science File Handling for the latest session from StudiesToday.com

Can I download the Practice worksheets of Class 12 Computer Science File Handling in Pdf

Yes, you can click on the links above and download chapter-wise Practice worksheets in PDFs for Class 12 for Computer Science File Handling

Are the Class 12 Computer Science File Handling Practice worksheets available for the latest session

Yes, the Practice worksheets issued for File Handling Class 12 Computer Science have been made available here for the latest academic session

How can I download the File Handling Class 12 Computer Science Practice worksheets

You can easily access the links above and download the Class 12 Practice worksheets Computer Science for File Handling

Is there any charge for the Practice worksheets for Class 12 Computer Science File Handling

There is no charge for the Practice worksheets for Class 12 CBSE Computer Science File Handling you can download everything free

How can I improve my scores by solving questions given in Practice worksheets in File Handling Class 12 Computer Science

Regular revision of practice worksheets given on studiestoday for Class 12 subject Computer Science File Handling can help you to score better marks in exams

Are there any websites that offer free Practice test papers for Class 12 Computer Science File Handling

Yes, studiestoday.com provides all the latest Class 12 Computer Science File Handling test practice sheets with answers based on the latest books for the current academic session

Can test sheet papers for File Handling Class 12 Computer Science be accessed on mobile devices

Yes, studiestoday provides worksheets in Pdf for File Handling Class 12 Computer Science in mobile-friendly format and can be accessed on smartphones and tablets.

Are practice worksheets for Class 12 Computer Science File Handling available in multiple languages

Yes, practice worksheets for Class 12 Computer Science File Handling are available in multiple languages, including English, Hindi