Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

why to use self in python

By using the “self” keyword we can access the attributes 
and methods of the class in python.
It binds the attributes with the given arguments.
self is parameter in function and user can use another parameter 
name in place of it.
But it is advisable to use self because,
it increase the readability of code.
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
2+5 =