object-oriented programming in this variationwe access the code from within the class and explicitly pass the object pointer an as the first parameter ( self within the methodyou can think of an party(as shorthand for the above line when the program executesit produces the following outputso far so far so far so far the object is constructedand the party method is called four timesboth incrementing and printing the value for within the an object classes as types as we have seenin python all variables have type we can use the built-in dir function to examine the capabilities of variable we can also use type and dir with the classes that we create class partyanimalx def party(selfself self print("so far",self xan partyanimal(print ("type"type(an)print ("dir "dir(an)print ("type"type(an )print ("type"type(an party)codewhen this program executesit produces the following outputtype dir ['__class__''__delattr__''__sizeof__''__str__''__subclasshook__''__weakref__''party'' 'type type you can see that using the class keywordwe have created new type from the dir outputyou can see both the integer attribute and the party method are available in the object