Can one help me write the "dimension (matrix)" function that receives an array as a parameter and prints the dimensions of the received array in iXj format?
def crie_matriz(n_linhas, n_colunas, valor):
matriz = []
for i in range(n_linhas):
linha = []
for j in range(n_colunas):
linha.append(valor)
matriz.append(linha)
for n in matriz:
print(''.join(map(str,matriz)))
return matriz
a = crie_matriz(2,3)
print(a)
The above code I printed prints the output, but the question asks you to print the dimension as in the example below:
minha_matriz = [[1], [2], [3]]
dimensoes(minha_matriz)
3X1
minha_matriz = [[1, 2, 3], [4, 5, 6]]
dimensoes(minha_matriz)
2X3