Text File Handling Set-2: 2 Marks Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 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