🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित कोड का उद्देश्य क्या है?

What is the purpose of the following code ?

import numpy as np
z=[1,2,3]
y=np.array(z)
A)
B)
C)
D)

Explanation:

The code provided:

import numpy as np
z = [1, 2, 3]
y = np.array(z)

Explanation:

  • z = [1, 2, 3]: This creates a regular Python list with elements 1, 2, and 3.
  • y = np.array(z): This converts the Python list z into a NumPy array and stores it in y.

Thus, the purpose of the code is to convert the list z into a NumPy array.

Answer: (A) to convert z to array

Latest Updates