Bird
0
0

What does np.arange(3) produce?

easy📝 Conceptual Q11 of 15
NumPy - Creating Arrays
What does np.arange(3) produce?
A[0, 1, 2]
B[1, 2, 3]
C[0, 1, 2, 3]
D[3]
Step-by-Step Solution
Solution:
  1. Step 1: Understand default start value

    If only one number is given, np.arange starts from 0 by default.
  2. Step 2: Identify stop value exclusion

    The stop value 3 is excluded, so the array includes 0, 1, 2.
  3. Final Answer:

    [0, 1, 2] -> Option A
  4. Quick Check:

    Start=0, stop=3 excluded, so [0,1,2] [OK]
Quick Trick: Remember: stop value is NOT included in output [OK]
Common Mistakes:
  • Including the stop value in the array
  • Starting from 1 instead of 0
  • Confusing step with stop

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes