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