classes are objectstoo in pythonclasses are objectstoo they are created when defining class using the class statement after defining the account classexactly one class object for the account class becomes available each time we call this class ( annesacc account())we create new instance object of this class the object annesacc is automatically linked to the account class objectwe say annesacc 'is-aaccountbecause it' an instance of the account class when we try to access component (an attribute or methodof an object using the dot notation in the way objectname componentnamepython first looks in the object itself each object can be seen as its own namespace if python finds the componentname thereit is happy if it doesn'tit looks in the class object of the class from which the object was created if it doesn' find the componentname therean error occurs let' look at an example assume that the account class has three methodswithdraw(selfamount)deposit(selfamountand print info(selfwe created the object annesacc by calling the account classand then we assigned an attribute to the annesacc object by writing annesacc balance the annesacc object is linked to the class it was created fromas shown in the image on the next page when we use the dot notation in order to access an attribute or method of the annesacc objectpython starts searching for this attribute or component at the object itself for examplewhen accessing the balance attribute (print(annesacc balance))it finds the attribute right at the object and is happy theoreticallyyou can also define methods only for particular instances practicallymethods are always defined within classes we can call the methods 'on an objectusing the dot notation againlike for instance in line herepython first looks at the objectbut it doesn' have method called deposit(amountpython then checks the class from which the object was createdand finds the method there the deposit(selfamountmethod of the account class object is then called in particular waywhich we will consider using our example although the method deposit(selfamounthas two parameterswe only have to call it with one parameter (the amount of money we intend to depositwe have already learned thatt he three methods are so-called instance methodswhich means they should only be called 'on an object' in the waysomeobject method(parameters when we define an instance method (inside class)the first parameter has to be called self by convention when we call the instance methodpython automatically annemarie friedrichcis lmu munchenws /