Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyPoint():
- def __init__(self,coord_x,coord_y,colour):
- self.__coord_x=coord_x
- self.__coord_y=coord_y
- self._colour=""
- def getCoord_x(self):
- return self.__coord_x
- def getCoord_y(self):
- return self.__coord_y
- def getColour(self):
- return self.__colour
- def setCoord_x(self,x):
- self.__coord_x=x
- def setCoord_y(self,y):
- self.__coord_y=y
- def setCoord_x(self,x):
- self.__coord_x=x
- def setColour(self,col):
- list={'red','green','blue','yellow','magenta'}
- if col in list:
- self.__colour=col
- def __str__(self):
- return "Point of (" + str(self.__coord_x) + ", "+str(self.__coord_y)+") of colour "+self.__colour
- -------------------------------------------------------------------------------------------------------------
- class PointRepository():
- def __init__(self):
- self.__data=[]
- def getData(self,data)
- return self.__data
- def printData(repo):
- points=repo.getData()
- if (len(points)==0)
- print("No points")
- else
- for elem in points:
- print(str(elem))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement