I have two functions that I can use to make an array:
def makelist(size):
list = []
for i in range(size):
list = list + [None]
return list
def mmatrix(rows,cols):
matrix = makelist(rows)
for i in range(rows):
matrix[i] = makelist(cols)
return matrix
When I make an array: mmatrix(3,3)), it prints all three arrays on the same line. How do I insert new lines between arrays?
You can simplify your code to:
To answer your question, the clearest way is to print the lines one by one: