Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

overload operator python

class Vector:
  def __init__(self, x, y):
    self.x = x
    self.y = y
   
   def __add__(self, other):
      return Vector(self.x + other.x, self.y + other.y)
 
PREVIOUS NEXT
Tagged: #overload #operator #python
ADD COMMENT
Topic
Name
5+9 =