0% found this document useful (0 votes)
4 views1 page

Python Lab Assignment

The document outlines a Python lab assignment focused on file handling and object-oriented programming. It includes tasks such as creating and manipulating text files, counting words and characters, and defining classes for 'Student' and 'BankAccount'. Additionally, it requires the implementation of methods for inputting, displaying, and saving data related to students and employees.

Uploaded by

nkjyotish.cse
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)
4 views1 page

Python Lab Assignment

The document outlines a Python lab assignment focused on file handling and object-oriented programming. It includes tasks such as creating and manipulating text files, counting words and characters, and defining classes for 'Student' and 'BankAccount'. Additionally, it requires the implementation of methods for inputting, displaying, and saving data related to students and employees.

Uploaded by

nkjyotish.cse
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

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.

You might also like