This is one question that every python newbie comes across.
Let's take a code snippet
class Test(object):
def __init__(self):
self.name = 'This is a test code'
def test_method(self):
print self.name
The __init__ () method in python is responsible for creating the instance of a class (here Test class). This is the method that get's called whenever you create an instance of a class. This basically acts as a constructor for a python class.
The argument list in __init() is the list of argument passed in to the constructor to initialize the argument.
When we say self.name the variable name is bound to the object of Test Class. These types of variables are the part of object and have the same life as of the obect. We can consider them as the instance variable which are available for the class that is beyond the scope of any function.
Similarly the name of a function that is qualified with 'self' refers to a method function that is part of the class definition.