#PYTHON PROGRAM TO DEFINE A CLASS AND INSTANTIATE AN OBJECT
class Employee:
def __init__(self, name, place):
self.name = name
self.place = place
def employee_Details(self):
print("Hello, my name is", self.name,"and I am from :",self.place)
#instantitaite the object
emp1 = Employee("Ram","Pune")
emp1.employee_Details()
#instantitaite the object
emp2 = Employee("Sam","Mumbai")
emp2.employee_Details()
OUTPUT:
Hello, my name is Ram and I am from : Pune
Hello, my name is Sam and I am from : Mumbai
On this page of the site you can watch the video online How to instantiate object in python? with a duration of hours minute second in good quality, which was uploaded by the user PythonEnthusiasts 01 January 1970, share the link with friends and acquaintances, this video has already been watched 8 times on youtube and it was liked by 0 viewers. Enjoy your viewing!