From 8f1ffd99807e3fb9f8dcd7629127da3b9fc85ccb Mon Sep 17 00:00:00 2001 From: sofi ?? <121195663+billnaithescienceguy@users.noreply.github.com> Date: Fri, 24 Feb 2023 19:40:41 +0000 Subject: [PATCH] message --- main.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 104be10..567adce 100644 --- a/main.py +++ b/main.py @@ -1,2 +1,28 @@ class Vector2d: - pass \ No newline at end of file + def __init__ (self x,y): + self.x=x + self.y=y + + def __repr__ (self): + return f"Vector2d(x={self.x}, y={self.y})" == True + + def __str__ (self): + return f"(self.x)+(self.y)" + + def __abs__ (self): + return f"(self.x**5, self.y**2)" + + def __eq__ (self): + return f"(self.x==self.y)" == True + + def __sub__ (self): + return Vector2d(self.x - other.x, self.y - other.y) + + def __add__(self): + return Vecotr2d(self.x + other.x, self.y + other.y) + + def __neg__(self): + return Vector2d(-self.x, -self.y) + + def __eq__(self): + return \ No newline at end of file