edhesive 9.6 code practice:
4x5 grid array called n
n=[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]
and use a def printIt: and change n to [1,1,1,1,1],[2,2,2,2,2],[3,3,3,3,3],[4,4,4,4,4]
1
Expert's answer
2020-11-20T10:10:52-0500
n = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]
def printIt(mat):
for i in range(4):
min_el = mat[i][i]
for j in range(5):
mat[i][j] = min_el
print(mat)
printIt(n)
Comments
Leave a comment