KnowledgeBoat Logo

Class - 12 CBSE Computer Science Important File Handling Questions 2025

  • Python Data Handling

    Write a function to insert a sentence in a text file, assuming that text file is very big and can't fit in computer's memory.


  • Python Data Handling

    Write a program to read a file 'Story.txt' and create another file, storing an index of 'Story.txt', telling which line of the file each word appears in. If word appears more than once, then index should-show all the line numbers containing the word.


  • Python Data Handling

    Write a program to accept a filename from the user and display all the lines from the file which contain Python comment character '#'.


  • Python Data Handling

    Reading a file line by line from the beginning is a common task. What if you want to read a file backward ? This happens when you need to read log files. Write a program to read and display content of file from end to beginning.


  • Python Data Handling

    Write a Python program to display the size of a file after removing EOL characters, leading and trailing white spaces and blank lines.


  • Python Data Handling

    Write a function Remove_Lowercase() that accepts two file names, and copies all lines that do not start with lowercase letter from the first file into the second file.


  • Python Data Handling

    Write a program to display all the records in a file along with line/record number.


  • Python Data Handling

    Write a method in Python to write multiple line of text contents into a text file "mylife.txt".


  • Python Data Handling

    Write a program to add two more employees' details (empno, ename, salary, designation) to the file "emp.txt" already stored in disk.


  • Python Data Handling

    Write code to open the file in the previous question and print it in the following form:

    Name : <name>    Phone: <phone number>


Showing 21 - 30 of 59 Questions