What is Self in python ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is Self in python ?

It's working like this pointer according to other languages like java or c++

26th Feb 2018, 5:33 PM
Azeem Ghafoor
Azeem Ghafoor - avatar
1 Answer
+ 2
By convention, this argument is always named self. In the init method, self refers to the newly created object; in other class methods, it refers to the instance whose method was called.
26th Feb 2018, 5:33 PM
Azeem Ghafoor
Azeem Ghafoor - avatar