ezoic

Monday, June 24, 2019

Understanding self and __init__ method in python Class.



https://micropyramid.com/blog/understand-self-and-__init__-method-in-python-class/


self :
self represents the instance of the class. By using the "self" keyword we can access the attributesand methods of the class in python.

__init__ :
"__init__" is a reseved method in python classes. It is known as a constructor in object oriented concepts. This method called when an object is created from the class and it allow the class to initialize the attributes of a class.

No comments:

Post a Comment

looking for a man

 I am a mid aged woman.  I was born in 1980. I do not have any kid. no complicated  dating before . I am looking for a man here for marriage...