Answer to Question #145553 in Python for Thomas Shaw

Question #145553
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS