Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Old MathJax webview Given a array of dimensions n rows by m columns entered by the user (The array will be created one by one

Old MathJax webview

Given a array of dimensions n rows by m columns entered by the user (The array will be created one by one by the user's input) and print the resulting array, find and print: 1.- The elements of the main diagonal 2.- Multiply the elements of the main diagonal by a scalar entered by the user and print the resulting array 3.- Indicate if the array is null (all elements are 0) and print the resulting array 4.- Indicate if a array is superior triangular (if all the elements below the main diagonal are null) and print the resulting array or lower (if all the elements located above said diagonal are null) and print the resulting array 5.- Indicate if it is a diagonal array ( If a array is both upper and lower triangular, it only has elements on the main diagonal) and print the resulting array in each case 6.-Create a menu (the menu must be defined as a function in addition to being In each of the options (1-6), to create the menu you can use lists, tuple, dictionary ...)

image text in transcribed

image text in transcribed

In the photos is the code as an example or help, it also has errors and is incomplete, kindly use python 3, also print the different matrices in each case, create the menu, please do everything, especially literal 5, do everything

You cannot use python functions for any reason, you can loop using nested loops, example of error in line 40 (array.zise), you cannot use any python function, otherwise it will be scored with zero, the minimum score 0

# 1 Nm 0 000 A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 NNNNNN min D import numpy as np def Diagonal(math, row,col): print("MatrisDiagonal:', end='') for i in range(row): for j in range(col): #condicion para diagonal if(i==j): print(math[i][j], end=',') def Triangular(M): for i in range(1, len(M)): for j in range(0,i): if(M[i][j] != e): return false return True row=int(input(': ')) col=int(input(': ')) array = [] print(":") for i in range(row): a =[] for j in range(col): print("row',i+1,', ', 'col',j+1,':') a.append(int(input())) array.append(a) for i in range (row): print('T',end='') for j in range(col): print(array[i][j], end ") print('') print(array) print(Diagonal(array,row,col)) print('x 4') for i in range(@, row): for j in range(0, col): if i-sj: print(array[i][j] * 4,",", end=" ") else: print(array[i][j],",", end="") print() if array.size==0: print("Matrix NuLL') else: print('no') triangular=Triangular(array) if triangular: print('triangular') print(Triangular (array)) a 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 mmmmmmm 41 42 43 44 45 46 47 Console 2/A X row 3 , col 1 : 4 4 row 3 , col 2 : 5 5 row 3 , col 3 : WU1 5 [2] 3 ] 2 ] [1 ] 2 ] 3] [4] 5 ] 5 ] [[2, 3, 2], [1, 2, 3], [4, 5, 5]] MatrisDiagonal:2,2,5, None x 4 8 3 2, 1,8, 3, 4, 5, 20 X 00 3 2 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions