@@ -23,23 +23,23 @@ def __init__(self, x: SupportsFloat = 0.0, y: SupportsFloat = 0.0) -> None:
2323 self .x = x
2424 self .y = y
2525 else :
26- raise TypeError (' You must pass in int/float value for x and y!' )
26+ raise TypeError (" You must pass in int/float value for x and y!" )
2727
2828 def __repr__ (self ) -> str :
2929 """Return the vector representation.
3030
3131 Returns:
3232 The representation of the vector.
3333 """
34- return f' vector.Vector2D({ self .x } , { self .y } )'
34+ return f" vector.Vector2D({ self .x } , { self .y } )"
3535
3636 def __str__ (self ) -> str :
3737 """The vector as a string.
3838
3939 Returns:
4040 The vector as a string.
4141 """
42- return f' ({ self .x } , { self .y } )'
42+ return f" ({ self .x } , { self .y } )"
4343
4444 def __abs__ (self ) -> float :
4545 """Return the length (magnitude) of the vector.
@@ -74,7 +74,7 @@ def __lt__(self, other_vector: Vector2D) -> bool:
7474 False, else.
7575 """
7676 if not isinstance (other_vector , Vector2D ):
77- raise TypeError (' You must pass in a Vector2D instance!' )
77+ raise TypeError (" You must pass in a Vector2D instance!" )
7878 return abs (self ) < abs (other_vector )
7979
8080 def __add__ (self , other_vector : Vector2D ) -> Vector2D :
@@ -87,7 +87,7 @@ def __add__(self, other_vector: Vector2D) -> Vector2D:
8787 The addition vector of the self and the other vector.
8888 """
8989 if not isinstance (other_vector , Vector2D ):
90- raise TypeError (' You must pass in a Vector2D instance!' )
90+ raise TypeError (" You must pass in a Vector2D instance!" )
9191 x = self .x + other_vector .x
9292 y = self .y + other_vector .y
9393 return Vector2D (x , y )
@@ -102,7 +102,7 @@ def __sub__(self, other_vector: Vector2D) -> Vector2D:
102102 The subtraction vector of the self and the other vector.
103103 """
104104 if not isinstance (other_vector , Vector2D ):
105- raise TypeError (' You must pass in a Vector2D instance!' )
105+ raise TypeError (" You must pass in a Vector2D instance!" )
106106 x = self .x - other_vector .x
107107 y = self .y - other_vector .y
108108 return Vector2D (x , y )
@@ -125,7 +125,7 @@ def __mul__(
125125 result : SupportsFloat = self .x * other .x + self .y * other .y
126126 return result
127127 if not isinstance (other , numbers .Real ):
128- raise TypeError (' You must pass in an int/float!' )
128+ raise TypeError (" You must pass in an int/float!" )
129129 return Vector2D (self .x * other , self .y * other )
130130
131131 def __truediv__ (self , other : SupportsFloat ) -> Vector2D :
@@ -142,5 +142,5 @@ def __truediv__(self, other: SupportsFloat) -> Vector2D:
142142 The multiplication of self and the other vector/number.
143143 """
144144 if not isinstance (other , numbers .Real ):
145- raise TypeError (' You must pass in an int/float!' )
145+ raise TypeError (" You must pass in an int/float!" )
146146 return Vector2D (self .x / other , self .y / other )
0 commit comments