Update linesegment.py
Make method str() to an overwritten operator __str__()
This commit is contained in:
@@ -60,7 +60,7 @@ class LineSegment:
|
|||||||
def get_max_y(self):
|
def get_max_y(self):
|
||||||
"""Get the highest y coordinate of the line segment"""
|
"""Get the highest y coordinate of the line segment"""
|
||||||
return max(self.__startpoint.get_y(), self.__endpoint.get_y())
|
return max(self.__startpoint.get_y(), self.__endpoint.get_y())
|
||||||
def str(self):
|
def __str__(self):
|
||||||
"""Return the line segment values as string."""
|
"""Return the line segment values as string."""
|
||||||
return self.__startpoint.str() + "-->" + self.__endpoint.str()
|
return self.__startpoint.str() + "-->" + self.__endpoint.str()
|
||||||
def draw(self):
|
def draw(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user