Question: complete this code in python for me please class Matrix: def _ _ init _ _ ( self , name, data ) : self.name =

complete this code in python for me please class Matrix:
def __init__(self, name, data):
self.name = name
self.data = data
self.row = len(data)
if self.row ==0:
self.col =0
else:
self.col = len(data[0])
def __str__(self):
# return the string to be printed. It should be formatted correctly
s ="
"+ self.name +"=
"
if self.data ==[]:
return s+'[]
'
for i in range(self.row):
for j in range(self.col):
s += str(self.data[i][j])+""
s +="
"
return s
if __name__=='__main__':
#you can write your test code here
pass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!