Question: 1. What does the following code do? x=20 not np.any([x%i == 0 for i in range(2, x)]) a. Finds whether x is 0 b. Finds

1. What does the following code do?

x=20 not np.any([x%i == 0 for i in range(2, x)])

a. Finds whether x is 0

b. Finds whether x contains 0

c. Finds whether x is even

d. Finds whether x is prime

2.What is the output of this code?

a = np.array([1,2]) b = np.array([3,4,5])

c = b[1:]

b[a] is c

a. True

b. False

c. NaN

d. This code contains an error

3. What is the output of this code?

a = np.array([1,2]) b = np.array([3,4,5]) b[a]

a. array([4, 6, 5])

b. This code contains an error

c. array([4, 5])

d. array([1, 2, 3, 4, 5])

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!