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
What is the usage of dir() and dir() function in python?
Tell me how do you debug a program in python?
What is a super constructor?
What is difference between range and arange function in python?
Do you know how is memory managed in python?
What is python? State some programming language features of python.
Is there any tool used to find bugs or carrying out static analysis?
What happened if we call a key that is not present in dictionary and how to tackle that kind of error ?
What is def __ init __ in python?
What is the output for the following code?
What is the use of try, except, finally and raise in error handling?
What is used to represent Strings in Python? Is double quotes used for String representation or single quotes used for String representation in Python?
Is python object-oriented? What is an object-oriented programming
What is cgi in python?
Tell us something about garbage collector in python?