Respuesta :

Answer:

def printIt(a):

   for r in range(len(a)):

       for c in range(len(a[0])):

           print(a[r][c], end = " ")

       print(" ")

   print(" ")

   

   for r in range(len(a)):

       x = a[r][r]

       for c in range(len(a[0])):

           a[r][c] = x

           

   for r in range(len(a)):

       for c in range (len(a[0])):

           print(a[r][c], end = " ")

       print(" ")

   

N = []

N.append([1, 2, 3, 4, 5])

N.append([1, 2, 3, 4, 5])

N.append([1, 2, 3, 4, 5])

N.append([1, 2, 3, 4, 5])

printIt(N)

Explanation:

<3

In this exercise we have to have knowledge in python computational language to write code like:

The code can be found in the attached image.

What is an Array?

Widely used by programmers, array is a simple data structure present in most programming languages. Its main purpose is to be a continuous space in memory to organize and store a collection of elements.

This code can be written as:

N = [1,1,1,1,1], [2,2,2,2,2], [3,3,3,3,3], [4,4,4,4,4]

def printIt(ar):

for row in range(len(ar)):

for col in range(len(ar[0])):

print(ar[row][col], end=" ")

print("")

N=[]

for r in range(4):

N.append([])

for r in range(len(N)):

value=1

for c in range(5):

N[r].append(value)

value=value + 1

printIt(N)

print("")

newValue=1

for r in range (len(N)):

for c in range(len(N[0])):

N[r][c] = newValue

newValue = newValue + 1

printIt(N)

See more about python at brainly.com/question/18502436

Ver imagen lhmarianateixeira