educative.io

Error in Q3 of the DS interview handbook numpy section

The third question in NumPy asks about the output of this code:

import numpy
x = numpy.array([2,4,6,8,10])
y = numpy.arange(0,15,3)
z = x*y
print (z[3])

and the answer is 72 (since x[3] = 8 and y[3] = 9 and the lengths of x and y are the same), but it marks the answer as It will result in an error, which is incorrect

Hi @Sam_McDermott,

You’re right, the correct answer for Q3 is 72. Thank you for letting us know. We’ve fixed the Q3 in our lesson. Thanks!

Happy Learning :slight_smile: