contains an assignment statementbecause this assignment assigns the name data inside the classit lives in the class' local scope and becomes an attribute of the class object like all class attributesthis data is inherited and shared by all instances of the class that don' have data attributes of their own when we make instances of this classthe name data is attached to those instances by the assignment to self data in the constructor methodx mixednames( mixednames( display() display( spam spam make two instance objects each has its own data self data differsmixednames data is the same the net result is that data lives in two placesin the instance objects (created by the self data assignment in __init__)and in the class from which they inherit names (created by the data assignment in the classthe class' display method prints both versionsby first qualifying the self instanceand then the class by using these techniques to store attributes in different objectswe determine their scope of visibility when attached to classesnames are sharedin instancesnames record per-instance datanot shared behavior or data although inheritance searches look up names for uswe can always get to an attribute anywhere in tree by accessing the desired object directly in the preceding examplefor instancespecifying data or self data will return an instance namewhich normally hides the same name in the classhowevermixed names data grabs the class' version of the name explicitly the next section describes one of the most common roles for such coding patternsand explains more about the way we deployed it in the prior methods because you already know about functionsyou also know about methods in classes methods are just function objects created by def statements nested in class statement' body from an abstract perspectivemethods provide behavior for instance objects to inherit from programming perspectivemethods work in exactly the same way as simple functionswith one crucial exceptiona method' first argument always receives the instance object that is the implied subject of the method call in other wordspython automatically maps instance method calls to class' method functions as follows method calls made through an instancelike thisinstance method(args are automatically translated to class method function calls of this formclass method(instanceargs class coding details