Question: import numpy as np data _ array = np . empty ( ( 8 , 8 ) ) #creates an empty 8 x 8 array

import numpy as np
data_array = np.empty((8,8)) #creates an empty 8 x 8 array
for i in range(0,8)
for j in range(0,8):
data_array[i][j]= j + i *8
print(data_array.size())
(a)(5 points) What is the output of this program?
(b)(5 points) Write the values in the second row of data_array after this program executes.
(c)(10 points) Write a function, EndsIn7(), that contains the following parameters:
(i) data_array: a 2D array of integers.
(ii) x_index: an integer corresponding to the x index of data_array.
(iii) y_index: an integer corresponding to the y index of data_array.
This function must return True if the integer at x_index, y_index in data_array has a 7
in the ones place. Otherwise, return False.

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 Programming Questions!