what is meaing of self in python …expalin it all about
Regarding doubt of python
what is init …i odes not understand it
hey @Ujjwal.madaan ,
self means an instance of the class .
With this you can easily access different variables declared in your class code. So that you can easily differentiate between variables used , which are local inside a function and which are to be used for the full class.
And the init function , it plays the role of constructors we have in c++. The same functioning of assigning the variables with the values provided as parameters to class object.
I hope this helps.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.