Update 'point.py'
Some checks failed
continuous-integration/drone/push Build is failing

Add __ne__ operator to class Point
This commit is contained in:
2020-03-11 12:55:19 +01:00
parent ff5742b08c
commit d85aa7a76d

View File

@@ -24,6 +24,9 @@ class Point():
def __eq__(self, other)
"""Returns True if the points coordinates are the same, else returns False"""
return self.get_x() == other.get_x() and self.get_y() == other.get_y()
def __ne__(self, other)
"""Returns True if the points coordinates are the different, else returns False"""
return self.get_x() != other.get_x() or self.get_y() != other.get_y()
def __str__(self):
"""Returns the coordinates as a string"""
return "(" + str(self.get_x()) + "/" + str(self.get_y()) + ")"