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

Python 1

The document defines a Faculty class that initializes with faculty ID, name, and salary through user input. It includes a display method to print the faculty details. Two instances of the Faculty class are created and displayed.

Uploaded by

noxadi3388
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Python 1

The document defines a Faculty class that initializes with faculty ID, name, and salary through user input. It includes a display method to print the faculty details. Two instances of the Faculty class are created and displayed.

Uploaded by

noxadi3388
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

class Faculty:

def __init__(self):
self.id = int(input("Enter faculty ID: "))
self.name = input("Enter faculty name: ")
self.salary = float(input("Enter faculty salary: "))

def display(self):
print("Faculty ID:", self.id)
print("Faculty Name:", self.name)
print("Faculty Salary:", self.salary)

# Creating and displaying faculty objects


obj1 = Faculty()
obj1.display()

obj2 = Faculty()
obj2.display()

You might also like