Question: a) b) c) PLEASE ANSWER ASAP!! I have come back after a few months, I hope to be impressed by the Chegg scholars. . The

a)

 a) b) c) PLEASE ANSWER ASAP!! I have come back aftera few months, I hope to be impressed by the Chegg scholars.. The script is partially complete. It reads in user data to

b)

create a matrix of inputs, splitting on commas as seen in the c)

lectures. You are to complete the missing function printUntilEvens (m). The function

PLEASE ANSWER ASAP!! I have come back after a few months, I hope to be impressed by the Chegg scholars.

. The script is partially complete. It reads in user data to create a matrix of inputs, splitting on commas as seen in the lectures. You are to complete the missing function printUntilEvens (m). The function prints out the matrix, row by row, until reaching an even number and printing it out. However, as soon as the function finds and prints an even number on a row of a matrix, then no more elements on that row (to the right of the even er) should be printed. For example, for the input: 2,3,4 1,2,3 The ouput should be 2 1 2 If you accidently change the read in code or can't see a script you should reset to scaffold: i import numpy as np 2 3 def printUntilEvens (m): 4 # insert your code here... 5 6 7 8 9 10 11 #### ##### 12 ### DO NOT CHANGE ANYTHING IN THIS SECTION 13 inputs [] 14 15 while True: 15 while True: 16 n = input() 17 if n == '': 18 break 19 inputs.append([int(x) for x in n.split(",")]) 20 21 matrix = np.array(inputs) 22 printUntilEvens (matrix) 23 24 ### DO NOT CHANGE ANYTHING IN THIS SECTION 25 ############################################ Write a function sumBothDiag(matrix) that returns the sum along both diagonals. For example, if your function is given the following matrix: 1 2 3 4 5 6 7 8 9 your function should return 25, since 1 + 5 + 9 +3+7 is equal to 25. If the given matrix is not a square matrix, then your function should return 0. Hint: what pattern is present for indices along each diagonal? Write a function isAdjacent Positive (matrix) that is given a matrix of integers as a parameter (you may assume no other data types will be given), and returns a logical value. The function should return true if, to the immediate right of every zero in the matrix (i.e. next to the zero, on the right side), there is either a positive number, or there is nothing there at all (because the zero appears on the right edge of the matrix). Otherwise, the function returns false. For example, the matrix 1 2 3 0 4 2 3 4 5 6 should return true. If the matrix is empty, or the matrix has no zeroes, then your function should return true. Your solution must use nested loops (one loop inside another loop) Note: positive means > 0, not >= 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!