AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Informatics Practices

Introduction to NumPy

Standard difficulty · 20 questions · 40 marks · Time: 38 minutes

Name: Date: Score: ____ / 40

Show your working for Sections B and C. Answers are on the last page — try every question first!

Section A — Choose the correct answer8 × 1 = 8 marks
1.
NumPy stands for:
  1. New Python
  2. Natural Python
  3. Number Python
  4. Numerical Python
2.
What does this print?
import numpy as np
a = np.array([72, 54, 74, 71])
print(a.ndim)
  1. 4
  2. 2
  3. 1
  4. 3
3.
What does this print?
import numpy as np
a = np.array([[87, 41, 27, 51, 33], [45, 46, 49, 96, 66]])
print(a.shape)
  1. (10,)
  2. (5, 2)
  3. (2,)
  4. (2, 5)
4.
What does this print?
import numpy as np
a = np.zeros((4, 5))
print(a.size)
  1. 5
  2. 9
  3. 20
  4. 4
5.
All items of this array get one data type. Which?
import numpy as np
a = np.array([30, 'k', 13.75])
  1. string (Unicode text)
  2. integer
  3. a different type for each item
  4. float
6.
How many elements does this array have?
import numpy as np
a = np.arange(6, 44, 6)
  1. 8
  2. 38
  3. 6
  4. 7
7.
How many bytes do the elements of this array take in all (size × itemsize)?
import numpy as np
a = np.ones((3, 2), dtype=np.int32)
  1. 192
  2. 6
  3. 48
  4. 24
8.
What does this print?
import numpy as np
a = np.array([14, 25, 17])
print(a * 3)
  1. [42 75 51]
  2. [14 25 17 14 25 17]
  3. [14 25 17]
  4. [17 28 20]
Section B — Short answer8 × 2 = 16 marks
9.
Give two differences between a Python list and a NumPy array.
10.
What does each print show? Give (a) the first line (b) the second.
import numpy as np
L = [5, 8, 6]
A = np.array(L)
print(L * 3)
print(A * 3)
11.
Write the elements of this array, separated by commas.
import numpy as np
a = np.arange(7, 29, 5)
12.
For this array, what are (a) a.ndim (b) the number of rows (c) the number of columns (d) a.size?
import numpy as np
a = np.array([[5, 20], [84, 77], [59, 67]])
13.
What are the elements of c? Write them separated by commas.
import numpy as np
a = np.array([24, 13, 17, 45])
b = np.array([32, 30, 33, 28])
c = a + b
14.
Will the items of each array be int, float or str? (a) np.array([3, 19, 21], dtype=float) (b) np.array([36, 3, 19])
15.
Find (a) a.size (b) a.itemsize (c) the total bytes of its elements.
import numpy as np
a = np.ones((5, 6), dtype=np.int32)
16.
For this array, what are (a) the first element (b) the last element (c) a.size?
import numpy as np
a = np.arange(13)
Section C — Word problems4 × 4 = 16 marks
17.
Explain five attributes of a NumPy array with an example for a = np.array([[2, 4, 6], [1, 3, 5]]).
18.
The marks of 3 students in 3 tests are stored as a 2-D array of floats. Find (a) a.ndim (b) a.size (c) a.itemsize (d) the total bytes of its elements.
import numpy as np
a = np.array([[55, 94, 62], [9, 84, 35], [64, 48, 13]], dtype=float)
19.
What do the three print lines show?
import numpy as np
a = np.array([27, 10, 29])
b = np.array([57, 11, 32])
print(a + b)
print(a * 2)
print(b - a)
20.
A list of 330 whole numbers is turned into two arrays. Find (a) b.itemsize (b) the total bytes of b’s elements (c) the total bytes of f’s elements (d) how many more bytes f needs.
import numpy as np
data = list(range(330))
b = np.array(data, dtype=np.int32)
f = np.array(data, dtype=np.float64)
AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Informatics Practices

Answer key

Introduction to NumPy · AW-11IP-NPY-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.

QAnswerWorking
1(d) Numerical Python—
2(c) 1a flat list gives a 1-D array
3(d) (2, 5)2 rows, 5 columns
4(c) 20size = 4 × 5
5(a) string (Unicode text)one string makes every item a string
6(d) 76, 12, 18, 24, 30, 36, 42 (stops before 44)
7(d) 246 elements × 4 bytes (int32 is 4 bytes)
8(a) [42 75 51]arithmetic on an array works on every element; a list would repeat instead
9A list may hold items of different types; an array holds one type. Arrays support element-wise arithmetic and use less memory; lists do not.—
10(a) [5, 8, 6, 5, 8, 6, 5, 8, 6]; (b) [15 24 18]a list repeats; an array multiplies each element
117, 12, 17, 22, 27start at 7, add 5, stop before 29
12(a) 2; (b) 3; (c) 2; (d) 6shape (3, 2)
1356, 43, 50, 73element by element: 24 + 32, 13 + 30, 17 + 33, 45 + 28
14(a) float; (b) inta string beats a float, and a float beats an int; dtype=float forces floats
15(a) 30; (b) 4; (c) 120int32 = 32 bits = 4 bytes; 30 × 4
16(a) 0; (b) 12; (c) 130 to 12
17ndim = 2 (dimensions); shape = (2, 3) (rows, columns); size = 6 (elements); dtype = an integer type (int32 or int64, depending on the system); itemsize = bytes per element (4 for int32, 8 for int64).—
18(a) 2; (b) 9; (c) 8; (d) 72shape (3, 3); float64 = 8 bytes; 9 × 8
19(a) [84 21 61]; (b) [54 20 58]; (c) [30 1 3]each operation works element by element
20(a) 4; (b) 1,320; (c) 2,640; (d) 1,320330 × 4; 330 × 8; difference