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 initself name, data:
self.name name
self.data data
self.row lendata
if self.row :
self.col
else:
self.col lendata
def strself:
# return the string to be printed. It should be formatted correctly
s
self.name
if self.data :
return s
for i in rangeselfrow:
for j in rangeselfcol:
s strselfdataij
s
return s
if namemain:
#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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
