What is the output of the following?

2023

What is the output of the following?

  1. A.

    [[3 4]

    [10 20]]

  2. B.

    [[3 4]

    [11 21]]

  3. C.

    [[2 3]
    [11 21]]

  4. D.

    [[3 3]

    [11 20]]

Attempted by 1242 students.

Show answer & explanation

Correct answer: B

Explanation: Adding a scalar to a NumPy array is applied element-wise, so 1 is added to each element of the array. Printed output: [[ 3 4] [11 21]]

Explore the full course: Bpsc