Python Lab Assignment: File Handling &
Classes/Objects
1. Write a Python program to create a text file and write user input data into it.
2. Write a Python program to read the contents of a file and display them line by line.
3. Write a Python program to count the number of words and characters in a file.
4. Write a Python program to append new data to an existing file without deleting previous content.
5. Create a class 'Student' with attributes (name, roll number, marks). Write methods to input and
display student details.
6. Create a class 'BankAccount' with methods to deposit, withdraw, and display balance.
7. Write a Python program using a class to store employee details and save them into a file.
8. Write a Python program to read student data from a file and display it using a class.