Basic Numpy :- Quiz..!

1.How to convert numpy array to list?

A. array.list()
B. array.list
C. list.array()
D. list(array)

2.What will be printed?

a = np.array([1,2,3,5,8])
b = np.array([0,3,4,2,1])
c = a + b
c = c*a
print (c[2])

A. 7
B. 12
C. 10
D. 21
E. 28

3.What will be output for the following code?

a = np.array([[1,2,3],[0,1,4]])
print (a.size)

A. 1
B. 5
C. 6
D. 4

4.What will be output for the following code?

a = np.array([[1,2,3],[0,1,4]])
b = np.zeros((2,3), dtype=np.int16)
c = np.ones((2,3), dtype=np.int16)
d = a + b + c
print (d[1,2] )

A. 5
B. 7
C. 3
D. 4

3 Likes

1.D) list(array)
2. D) 21
3. C) 6
4. A) 5

1 Like

Awesome…! @nagmafariyal2017 Keep it up!

2 Likes

answers

  1. d
  2. d
  3. c
  4. a
1 Like

@vaishu.swap10112016 Good…!

1 Like

Answers for the quiz

  1. d
  2. d
  3. c
  4. a
1 Like