Python Programming (IT2121)
Session: 2025-2026
Topic: File Handling Programs
1. Understanding different file opening modes.
2. Write a Python program to read an entire text file.
3. Write a Python program to read first n lines of a file
4. Write a Python program to append text to a file and display the
text.
5. Write a Python program to read a file line by line and store it
into a list.
6. Write a Python program to read a file line by line store it into
an array.
7. Write a python program to find the longest word in the file.
8. Write a Python program to count the number of lines, words
and characters in a text file.
9. Write a Python program to count the frequency of words in a
file
10. Write a Python program to copy contents of a file into
another file.