It says I chose the incorrect answer, for the exercise before moving to the next lesson. However, I ran the code separately to make sure I was wrong, but it turns out I was right.
“What is the value of a after you run the following code?”
a = np.arange(5)
a + 20
[20, 21, 22, 24, 24]
[0, 1, 2, 3, 4]
[25, 26, 27, 28, 29]
The answer that it accepts is the second, [0, 1, 2, 3, 4]. This is cool but the code has a + 20, which I automatically read as “array([20, 21, 22, 23, 24])”. I tested it by running it separately to make sure and it returned “array([20, 21, 22, 23, 24])”.
Maybe I am still wrong and not seeing it. That’s completely fine by me, but if I’m not wrong I don’t want other users to go by and automatically think that [0, 1, 2, 3, 4] is the correct answer and not question it.


