appendix classes listing the point py module implements the point class for representing points in the - cartesian coordinate system import math class point creates point object def __init__selfxy )self xcoord self ycoord returns the coordinate of the point def getxself )return self xcoord returns the coordinate of the point def getyself )return self ycoord shifts the point by xinc and yinc def shiftselfxincyinc )self _xcoord +xinc self _ycoord +yinc computes the distance between this point and the otherpoint def distanceselfotherpoint )xdiff self xcoord otherpoint xcoord ydiff self ycoord otherpoint ycoord return math sqrtxdiff * ydiff * while any form of the import statement can be usedin this text we will always use the from/import version and explicitly indicate the class to be imported from the given module hiding attributes object-oriented programming allows for the encapsulation of data and the operations that can be performed on that data in other wordsthe data attributes of an object and the methods that are defined for use with the object are combined in single definition and implementation the class definition in turn provides an interface to user-defined type the data attributes contained in an object are usually hidden from the client or user code that is outside the class only the methods defined by the class for use with the object should directly access the data attributes this prevents the accidental corruption of the data that can occur when directly accessed by code outside the class sometimes we may also need to protect methods from outside use such as with helper method helper methods are like any other methodbut they are commonly used in the implementation of class to allow for the