0% found this document useful (0 votes)
246 views2 pages

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
246 views2 pages

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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 [Link].
2. Write a python program to count and display no. of lower case in a text
file [Link].
3. Write a python program to count and display no. of lower case vowels
in a text file [Link].
4. Write a python program to count and display no. of digits in a text file
[Link].
5. Write a python program to count and display no. of words in a text file
[Link].
6. Write a python program to count and display no. of spaces in a text file
[Link].

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

_________________

You might also like