Code:
class Person(object):
# Constructor
def __init__(self, name, id):
self.name = name
self.id = id
# To check if this person is an employee
def Display(self):
print(self.name, self.id)
# Driver code
emp = Person("Krishna", 999) # An Object of Person
emp.Display()
Output:
No comments:
Post a Comment