Data science course question error

There is an error in a question about Numpy operations from the data science course, the correct answer is 20,21,22,23,24 and it does not appear.

freecode

Take another look at the code in question, you may also try running it in the interpreter and seeing which answer is correct.

1 Like

try with

a = np.range(5)
a + 20
print(a)

in an interpreter where you have numpy installed, you may be surprised

1 Like
a = 5
a + 5

What is the value of a? The answer is not 10.

1 Like

You need to add print(a) at last line of the coding like I mentioned below:

a = np.range(5)
a + 20
print(a)

Installation of the numpy in interpreter is very important to check.

Please do not revive old threads to share information already contained in the thread. Thanks.