Bird
0
0

Given the numpy array:

medium📝 Predict Output Q13 of 15
NumPy - Indexing and Slicing
Given the numpy array:
import numpy as np
arr = np.array([[10, 20, 30], [40, 50, 60], [70, 80, 90]])
print(arr[2, 1])

What will be the output?
A80
B70
C60
D50
Step-by-Step Solution
Solution:
  1. Step 1: Identify the element at row 2, column 1

    Indexes are zero-based, so row 2 means third row: [70, 80, 90], column 1 means second element.
  2. Step 2: Find the value at arr[2, 1]

    The value is 80.
  3. Final Answer:

    80 -> Option A
  4. Quick Check:

    arr[2,1] = 80 [OK]
Quick Trick: Remember zero-based indexing: row 2 is third row [OK]
Common Mistakes:
  • Confusing row and column indexes
  • Using 1-based indexing
  • Reading the wrong element from the array

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes