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
How do you open an already existing file and add content to it?
Explain me what is a built-in function that python uses to iterate over a number sequence?
What are mixins in python?
Write the command to get all keys from the dictionary.
What is lambda function ?
Explain me what are the built-in types available in python?
What is the difference between numpy and pandas?
Does python support interfaces like in java?
Which website is best for python?
What can I build with python?
How do I use xrange in python 3?
How memcached should not be used in your python project?
Is c++ or python better?
How do you get all values from a python dictionary?
How do you delay time in python?