Professional Documents
Culture Documents
Roll No: 17
Class: TYCM1
Batch: C
Practical No: 14-A
1) Design a class employee with data members: name, department and salary. Create Suitable
methods for reading and printing employee information.
class Employee:
def __init__(self, name, dept, salary):
self.name=name
self.dept=dept
self.salary=salary
def myfunc(display):
print("Information: \n")
print("Name: "+ display.name)
print("Department: "+ display.dept)
print("Salary: "+ display.salary)
Output:
Information:
Name: Akhilesh
Department: IT
Salary: 4500000
class person:
def __init__(self):
self.name="Akhilesh Dolare"
def display(self):
print(self.name)
obj = person()
obj.display()
Output:
Akhilesh Dolare