Advertisements
Online Mock Tests
Chapters
1: Review of Phython
2: Concept of Object Oriented Programming
3: Classes in Python
4: Inheritance
Unit -2 : Advanced Programming with Python
1: Liner List Manipulation
2: Stacks & Queues in list
▶ 3: Data File Handling
4: Exception Handling & Generate Functions
Unit -3 : Databases Management Systems and SQL
1: Databases Concepts and SQL
2: Structure Query Language
Unit -4 : Introduction to Boolean Algebra
1: Boolean Algebra
2: Boolean Functions and Reduce Forms
Chapter 3: Application of Boolean Logic
Unit -5 : Communication Technologies
Chapter 1: Networking Concepts Part I
Chapter 2: Networking Concepts Part II
Chapter 3: Networking Protocols
Chapter 4: Mobile Telecommunication Technologies, Network Security and Internet Services
![CBSE solutions for कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ chapter 3 - Data File Handling CBSE solutions for कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ chapter 3 - Data File Handling - Shaalaa.com](/images/computer-science-with-python-english-class-12_6:c0c1e36c6bb846c19fd1bb8caad8e289.jpg)
Advertisements
Solutions for Chapter 3: Data File Handling
Below listed, you can find solutions for Chapter 3 of CBSE CBSE for कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२.
CBSE solutions for कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ 3 Data File Handling EXERCISE [Pages 145 - 146]
file = open('textfile.txt','w')
word = ''
while word.upper() != 'END':
word = raw_input('Enter a word use END to quit')
file.write(word + '\n')
file.close()
The above program is to create a file storing a list of words. What is the name of file on hard disk containing list of words?
Human readable form of file is called ______.
Write a try .... except statement that attempts to open a file for reading and catches the exception thrown when the file does not exist.
Compare and contrast read(), readline() and readlines().
How is write() different from writelines()?
In how many ways can end of file be detected?
How many file modes can be used with the open() function to open a file? State the function of each mode.
What does the seekg() and seekp() functions do?
Explain the use of output function write() with an example.
Explain the use of output function writelines() with an example.
Write a function that writes a structure to disk and then reads it back and display on screen.
file = open('textfile.txt','w')
word = ''
while word.upper() != 'END':
word = raw_input('Enter a word use END to quit')
file.write(word + '\n')
file.close
Using the file mentioned above, write a function to read the file and display numbered list of words.
file = open('textfile.txt','w')
word = ''
while word.upper() != 'END':
word = raw_input('Enter a word use END to quit')
file.write(word + '\n')
file.close()
In the code (given above), the word END used to indicate end of word list is also stored in the file. Modify the code so that end is not stored in the file.
Write a function that takes three argument 1st input file, 2nd output file and 3rd transformation function. First argument is the file opened for reading, second argument is the file opened for writing and third argument is a function, which takes single string and performs a transformation of your choice and returns the transformed string. The function should reed each line in the input file, pass the line through transformation function and then write transformed line to output file. A transformation can be - capitalize first alphabet of every word.
Write a function to create a text file containing following data.
Neither apple nor pine are in pineapple. Boxing rings are square.
Writers write, but fingers don't fing. Overlook and oversee are opposites. A house can burn up as it burns down. An alarm goes off by going on.
- Read back the entire file content using read() or readlines () and display on screen.
- Append more text of your choice in the file and display the content of file with line numbers prefixed to line.
- Display last line of file.
- Display first line from 10th character onwards.
- Read and display a line from the file. Ask user to provide the line number to be read.
Create a dictionary having decimal equivalent of roman numerals. Store it in a binary file. Write a function to convert roman number to decimal equivalent using the binary file data.
Write a program to delete the content provided by user from the binary file. The file is very large and can't fit in computers memory.
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.
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.
Hint : Dictionary with key as word(s) can be used to solve this.
Write a function called replace file(), that takes pattern string, replacement string and two file names as argument. The function should read the first file and write the content into second file (creating it, if necessary). If the pattern string appear anywhere in first file, it should be replaced by replacement string in second file.
Write a program to accept a filename from the user and display all the lines from the file which contain python comment character '#'.
Reading a file line by line from 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.
Create a class item to store information of different items, existing in a shop. At least following is to be stored w.r.t. each item code, name, price, qty. Write a program to accept the data from user and store it permanently in the file. Also provide user with facility of searching and updating the data in file based on code of item.
Solutions for 3: Data File Handling
![CBSE solutions for कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ chapter 3 - Data File Handling CBSE solutions for कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ chapter 3 - Data File Handling - Shaalaa.com](/images/computer-science-with-python-english-class-12_6:c0c1e36c6bb846c19fd1bb8caad8e289.jpg)
CBSE solutions for कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ chapter 3 - Data File Handling
Shaalaa.com has the CBSE Mathematics कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ CBSE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. CBSE solutions for Mathematics कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ CBSE 3 (Data File Handling) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.
Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. CBSE textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.
Concepts covered in कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ chapter 3 Data File Handling are .
Using CBSE कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ solutions Data File Handling exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in CBSE Solutions are essential questions that can be asked in the final exam. Maximum CBSE कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ students prefer CBSE Textbook Solutions to score more in exams.
Get the free view of Chapter 3, Data File Handling कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ additional questions for Mathematics कॉम्प्युटर सायन्स विद पाइथान [इंग्रजी] इयत्ता १२ CBSE, and you can use Shaalaa.com to keep it handy for your exam preparation.
