I've written a simple function as well as input for it, but I am not sure what to put into the "pass" for my desired output. Here is my code:
def print_matrix(matrix_in, rows, columns, matrix):
pass
def print_header(columns):
line = "+"
for i in range(columns):
line += "---+"
print(line)
matrix={(2, 2): 5, (1, 2): 4, (0, 1): 2, (0, 0): 1, (1, 1): 3, (2, 3): 6}
rows=3
columns=4
matrix="Matrix 1"
print_matrix(matrix, rows, columns, matrix)
For this desired output:
Matrix 1
+---+---+---+---+
| 1| 2| 0| 0|
+---+---+---+---+
| 0| 3| 4| 0|
+---+---+---+---+
| 0| 0| 5| 6|
+---+---+---+---+
Any help would be appreciated thank you.