classes and object-oriented programming it' important to note that class statement by itself doesn' create any instances of the class (for exampleno accounts are actually created in the preceding examplerathera class merely sets up the attributes that will be common to all the instances that will be created later in this senseyou might think of it as blueprint the functions defined inside class are known as instance methods an instance method is function that operates on an instance of the classwhich is passed as the first argument by conventionthis argument is called selfalthough any legal identifier name can be used in the preceding exampledeposit()withdraw()and inquiry(are examples of instance methods class variables such as num_accounts are values that are shared among all instances of class (that isthey're not individually assigned to each instancein this caseit' variable that' keeping track of how many account instances are in existence class instances instances of class are created by calling class object as function this creates new instance that is then passed to the _init_ (method of the class the arguments to _init_ (consist of the newly created instance self along with the arguments supplied when calling the class object for examplecreate few accounts account("guido" account("bill" invokes account _init_ ( ,"guido", inside _init_ ()attributes are saved in the instance by assigning to self for exampleself name name is saving name attribute in the instance once the newly created instance has been returned to the userthese attributes as well as attributes of the class are accessed using the dot operator as followsa deposit( withdraw( name name calls account deposit( , calls account withdraw( , get account name the dot operator is responsible for attribute binding when you access an attributethe resulting value may come from several different places for examplea name in the previous example returns the name attribute of the instance howevera deposit returns the deposit attribute ( methodof the account class when you access an attributethe instance is checked first and if nothing is knownthe search moves to the instance' class instead this is the underlying mechanism by which class shares its attributes with all of its instances scoping rules although classes define namespaceclasses do not create scope for names used inside the bodies of methods thereforewhen you're implementing classreferences to attributes and methods must be fully qualified for examplein methods you always reference attributes of the instance through self thusin the example you use self balancenot balance this also applies if you want to call method from another methodas shown in the following examplef lib fl ff