def get_scalar_product ( self , other ) : return self . x * other . x + self . y * other . y
code to perform scalar product in python
Returns the scalar product of this vector with the given other vector .
def get_scalar_product(self, other):
        """Returns the scalar product of this vector with the given
        other vector."""
        return self.x*other.x+self.y*other.y