Answer Posted / chaitanya
“Self” is a variable that represent the instance of the object to itself. In most of the object oriented programming language, this is passed as to the methods as a hidden parameters that is defined by an object. But, in python it is declare it and pass it explicitly. It is the first argument that gets created in the instance of the class A and the parameters to the methods are passed automatically. It refers to separate instance of the variable for individual objects. This is the first argument that is used in the class instance and the “self” method is defined explicitly to all the methods that are used and present. The variables are referred as “self.xxx”.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Does python perform tail recursion optimization?
What is a decorator?
What is MySQLdb?
What is negative index in Python?
What is slicing in python?
Can a beginner learn python?
Tell me the use of the split function in python?
Does Python support enums?
How do you upgrade pip?
How do I download a file over http using python?
What is a for loop in python?
Is string immutable ?
Given the first and last names of all employees in your firm, what data type will you use to store it?
What is pass in Python?
Is python client or server side?