Skip to content

Commit f176b18

Browse files
tianyizheng02poyea
andauthored
Apply suggestions from code review
Co-authored-by: John Law <[email protected]>
1 parent 53f9953 commit f176b18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

linear_algebra/src/lib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def set(self, components: Collection[float]) -> None:
123123
"""
124124
input: new components
125125
changes the components of the vector.
126-
replace the components with newer one.
126+
replaces the components with newer one.
127127
"""
128128
if len(components) > 0:
129129
self.__components = list(components)
@@ -319,7 +319,7 @@ def __sub__(self, other: Matrix) -> Matrix:
319319
matrix.append(row)
320320
return Matrix(matrix, self.__width, self.__height)
321321
else:
322-
raise Exception("matrix must have the same dimension!")
322+
raise Exception("matrices must have the same dimension!")
323323

324324
@overload
325325
def __mul__(self, other: float) -> Matrix:
@@ -415,7 +415,7 @@ def determinant(self) -> float:
415415
if self.__height != self.__width:
416416
raise Exception("Matrix is not square")
417417
if self.__height < 1:
418-
raise Exception("Matrix has no elements")
418+
raise Exception("Matrix has no element")
419419
elif self.__height == 1:
420420
return self.__matrix[0][0]
421421
elif self.__height == 2:

0 commit comments

Comments
 (0)