Python Programming - Classes - Discussion

Discussion Forum : Classes - General Questions (Q.No. 2)
2.
In Python, what does the term self refer to in a class method?
It represents the instance of the class.
It refers to the superclass object.
It is a keyword for defining class variables.
It is used for static method declaration.
Answer: Option
Explanation:
In Python, the term self is a convention used to represent the instance of the class. It is the first parameter in the method definition and refers to the instance on which the method is called.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.