choose name by asking for it from the class it lives in ( zbecause of the way inheritance searches proceedthe object to which you attach an attribute turns out to be crucial--it determines the name' scope attributes attached to instances pertain only to those single instancesbut attributes attached to classes are shared by all their subclasses and instances laterwe'll study the code that hangs attributes on these objects in depth as we'll findattributes are usually attached to classes by assignments made at the top level in class statement blocksand not nested inside function def statements there attributes are usually attached to instances by assignments to the special argument passed to functions coded inside classescalled self for exampleclasses provide behavior for their instances with method functions we create by coding def statements inside class statements because such nested defs assign names within the classthey wind up attaching attributes to the class object that will be inherited by all instances and subclassesclass class make superclass objects class ( )def setname(selfwho)self name who make and link class assign namec setname self is either or ( ( setname('bob' setname('sue'print( namemake two instances sets name to 'bobsets name to 'sueprints 'bobthere' nothing syntactically unique about def in this context operationallythoughwhen def appears inside class like thisit is usually known as methodand it automatically receives special first argument--called self by convention--that provides handle back to the instance to be processed any values you pass to the method yourself go to arguments after self (hereto who because classes are factories for multiple instancestheir methods usually go through this automatically passed-in self argument whenever they need to fetch or set attributes of the particular instance being processed by method call in the preceding codeself is used to store name in one of two instances like simple variablesattributes of classes and instances are not declared ahead of timebut spring into existence the first time they are assigned values when method assigns to self attributeit creates or changes an attribute in an instance at the bottom of the if you've ever used +or javayou'll recognize that python' self is the same as the this pointerbut self is always explicit in both headers and bodies of python methods to make attribute accesses more obviousa name has fewer possible meanings oopthe big picture