Skip to content

Matrix exercise - #127

Open
mayareu wants to merge 5 commits into
osherdp:masterfrom
mayareu:Matrix_exercise
Open

Matrix exercise#127
mayareu wants to merge 5 commits into
osherdp:masterfrom
mayareu:Matrix_exercise

Conversation

@mayareu

Copy link
Copy Markdown

No description provided.

Comment threadMatrix.py Outdated
return self.__matrix

def scalar_multiplication(self, scalar):
result = [tuple(map(lambda x: x * scalar, i)) for i in self.__matrix]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the use of map and lambda is not recommended, please change that

Comment threadMatrix.py
result = [tuple(map(lambda x: x * scalar, i)) for i in self.__matrix]
return tuple(result)

def addition(self, other_matrix):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your addition and subtraction look quite similar, think of a way to unify them

Comment threadMatrix.py
def get_size(self):
return self.__matrix.__len__()

def compare(self, other_matrix):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the other object type is not matrix?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mayareu@ranbentzvi