Question: Old MathJax webview Old MathJax webview Given a array of dimensions n rows by m columns entered by the user (The array will be created
Old MathJax webview
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: Create an Options menu (The menu must be created as a Function and receive Parameters, it must have the options as inside a list / dictionary or tuple, in addition to making the menu validation, example of menu (menu ([1,2,3,4 , 5,6] or menu = ([1,2,3,4,5,6])), in addition there must be the menu function in each option of the program 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 issuperior 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.exit the program ------
In the photos is the code as an example or help, it also has errors and is incomplete, kindly use python 3, -------



functions 5 6 and 7, the function (pass) must not be in the code, it must not be used! Don't use (pass)
Each function must print the Resulting matrix, the menu must be created as requested by the program, be validated and be in each of the options
You cannot use python functions for any reason, you can loop using nested loops, example of error functions 5 , 6 , 7 (pass), you cannot use any python function, otherwise it will be scored with zero, the minimum score 0
[1] import numpy as np Os Os [2] def Digonal (arr , row, col ): print("main digonal elements are :- [", end=" ") for i in range(row): for j in range(col): if (i==j): print(arr[i][j], end=' ,') print(" ]") Os [3] def MultiplyScalerWithDigonal(arr ,row, col , value): Temp_Arr=[] for i in range (row): a=[] for j in range(col): if (i==j): a.append(arr[i][j]*value) else: a.append(arr[i][j]) Temp_Arr.append(a) for i in range (len (Temp_Arr)): print(Temp_Arr[i]) [4] def PrintArray(arr): for i in range(len(arr)): print(end = "[ ") for j in range(len(arr[@])): print(arr[i][j] , end = ' ') print("] ") Os [4] def PrintArray(arr): for i in range(len (arr)): print(end = "[ ") for j in range(len(arr[@])): print(arr[i][j] , end = ' ') print("] ") Os [5] def IsNullOrNot (arr): if len(arr) != 0: for i in range(len(arr)): for j in range(len(arr[@])): if arr[i][j]!=0: print("This Array is not Null") PrintArray(arr) return 1 else: pass print("This Array is Null") PrintArray(arr) [6] def Is Superior Triangle(arr): 05 Indicate if a array is superior triangular (if all the and print the resulting array or lower (if all the elen and print the resulting arra HERE for i in range(len(arr)): for j in range(len( arr[@] )): if i==j and arr[i][j]!=0: pass elif i!=j and arr[i][j] ==0: pass else: print("It is not a Superior Array") return 1 print("It is a Superior Array") BEBER [7] def IsThisDigonalArr( arr ): *** "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" for i in range(len(arr)): for j in range(len( arr[@] )): if i==j and arr[i][j]!=0: pass elif i!=j and arr[i][j] ==0: pass else: print("It is not a Digonal Array") return 1 print("It is a Digonal Array")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
