0% found this document useful (0 votes)
86 views

Text File Handling Set-2: 2 Marks Questions

The document contains questions about text file handling in Python. It lists 2 mark, 3 mark and 4 mark questions that involve counting elements like special characters, lowercase letters, digits and words in text files, as well as copying words or lines between files based on certain criteria.

Uploaded by

PawanKumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views

Text File Handling Set-2: 2 Marks Questions

The document contains questions about text file handling in Python. It lists 2 mark, 3 mark and 4 mark questions that involve counting elements like special characters, lowercase letters, digits and words in text files, as well as copying words or lines between files based on certain criteria.

Uploaded by

PawanKumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Text File Handling Set-2

2 Marks Questions
1. Write a python program to count and display no. of special characters
in a text file PARA.TXT.
2. Write a python program to count and display no. of lower case in a text
file NOTES.TXT.
3. Write a python program to count and display no. of lower case vowels
in a text file NOTES.TXT.
4. Write a python program to count and display no. of digits in a text file
CHAPTER.TXT.
5. Write a python program to count and display no. of words in a text file
PARA.TXT.
6. Write a python program to count and display no. of spaces in a text file
PARA.TXT.

3 Marks Questions
1. Write a python program to count and display words ‘The’ present in a
text file Story.txt.
2. Write a python program to count and display words ending with ‘ch’ in
a text file Story.txt.
3. Write a python program to count and display no. of 3 character words
in a text file Story.txt.
4. Write a python program to count and display no. of the words starting
with vowels in a text file Story.txt.
5. Write a python program to display average word length in each line of
a text file Story.txt.
4 Marks Questions
1. Write a python program to open a text file THEORY.TXT, copy all the
words with 3 characters into another file named FILE3.TXT.
2. Write a Python program to open a text file THEORY.TXT, copy all the
words starting with character ‘s’ or ‘S’ into another file named
FILE3.TXT.
3. Write a Python program to open a text file THEORY.TXT, replace word
‘and’ with &.
4. Write a Python program to open a text file THEORY.TXT, copy all the
lines starting with the word ‘the’ into another file named FILE3.TXT.

_________________

You might also like