Page 1 of 1

Rewrite the following function using a while loop. det munched(values): Mysterious for a while. value linit 40 result D

Posted: Thu May 05, 2022 12:44 pm
by answerhappygod
Rewrite The Following Function Using A While Loop Det Munched Values Mysterious For A While Value Linit 40 Result D 1
Rewrite The Following Function Using A While Loop Det Munched Values Mysterious For A While Value Linit 40 Result D 1 (30.96 KiB) Viewed 45 times
Rewrite The Following Function Using A While Loop Det Munched Values Mysterious For A While Value Linit 40 Result D 2
Rewrite The Following Function Using A While Loop Det Munched Values Mysterious For A While Value Linit 40 Result D 2 (30.1 KiB) Viewed 45 times
Rewrite the following function using a while loop. det munched(values): Mysterious for a while. value linit 40 result D for item in values: if iten value limiti iten value limit result.append(item) return result Extra restrictions: • your answer must not contain a for loop your answer must contain a while loop your answer must contain only one return statement your answer cannot contain any break statements For example: Test Result print (unched( (20, 100, 30, 10, 4, 2001)) [20, 40, 30, 10, 4, 40) prant Councheo([1, 2, 3])) [1, 2, 3) print(nunched [00, 2, 1))) (40, 2, 1)
Suppose you have a 2d array containing all the test marks for students in ENCN305. Each row contains the test marks for a single student, with first value in the row being the student ID number For example, the marks for three tests, for just two students, might look like: [[2817893, 94.5, 90.3, 80.31. [2074312, 34.5, 00.25, 72.51] Write the function awesome, students(mark data) that takes a 2d array in the above format and retums an array containing the rows from he original array for students who have at least one test mark that is more than 95. Note: . Your function can contain at most three statements. . You can assume that there are no missing marks. . 22 is a valid student ID number. For example: Test Result data = np.array([ 2074312.9 39.9 96.2 72.5 22.0 77.5 99.2 44.5 [2917893, 70, no, 90], [2074312, 38, 96,25, 72.51, [22, 77.5, 00.25, 44.5). [2991122, 20, 90.25, 75.5) 1) result = awesome students(data) for row in result: for val in row: print('(:1).format(val), end=" ") print()