Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the function of “self”?

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


Please Help Members By Posting Answers For Below Questions

What is the usage of dir() and dir() function in python?

911


Tell me how do you debug a program in python?

866


What is a super constructor?

960


What is difference between range and arange function in python?

968


Do you know how is memory managed in python?

913


What is python? State some programming language features of python.

868


Is there any tool used to find bugs or carrying out static analysis?

1085


What happened if we call a key that is not present in dictionary and how to tackle that kind of error ?

829


What is def __ init __ in python?

929


What is the output for the following code?

904


What is the use of try, except, finally and raise in error handling?

841


What is used to represent Strings in Python? Is double quotes used for String representation or single quotes used for String representation in Python?

884


Is python object-oriented? What is an object-oriented programming

803


What is cgi in python?

924


Tell us something about garbage collector in python?

919