About this Question Bank
This panel collects every question from the course in one place: 405 moderate-level questions with answers and the answer key for 135 MCQs across 27 lessons. Use it for revision before the certificate examination.
Prerequisite : Programming Basics
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which flowchart symbol represents a decision? | C. Diamond |
| 2 | Which property says an algorithm must always end after a finite number of steps? | A. Finiteness |
| 3 | In CPython, source code is first converted into: | B. Bytecode |
| 4 | A program runs without any error message but prints the wrong answer. This is a: | D. Logical error |
| 5 | Which statement about a compiler is TRUE? | C. It translates the whole program before execution |
Chapter-1 | Google Colab and Python Basics
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Python was created by: | B. Guido van Rossum |
| 2 | What is the output of print("A", "B", sep="-")? | C. A-B |
| 3 | Which of these is a VALID identifier? | A. _total1 |
| 4 | Which keyboard shortcut runs the current cell in Google Colab? | D. Shift + Enter |
| 5 | Which symbol begins a single-line comment in Python? | B. # |
Chapter-2 | Variables and Data Types
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What is the output of print(type(3.0))? | B. <class 'float'> |
| 2 | Which of the following data types is MUTABLE? | D. list |
| 3 | After x, y = 5, 9 and then x, y = y, x, what is the value of x? | A. 9 |
| 4 | What is the type of None? | C. NoneType |
| 5 | What does isinstance(True, int) return? | B. True |
Chapter-3 | Basic Operators
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What is the output of print(7 // 2)? | C. 3 |
| 2 | What is the output of print(2 ** 3 ** 2)? | B. 512 |
| 3 | Which operator checks whether two names refer to the SAME object? | A. is |
| 4 | What does print(0 or "default") display? | D. default |
| 5 | What is the result of 10 / 2 in Python 3? | B. 5.0 |
Chapter-4 | Data Reading (Input) and Type Casting
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What is the data type of the value returned by input()? | D. str |
| 2 | What is the output of print(int(9.99))? | A. 9 |
| 3 | What does bool("0") return? | B. True |
| 4 | Which exception is raised by int("12a")? | C. ValueError |
| 5 | What does f"{3.14159:.2f}" produce? | D. 3.14 |
Chapter-5 | Decision Making
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which keyword checks another condition when the previous if condition is False? | B. elif |
| 2 | What is printed by: x = 0; print("Yes" if x else "No")? | C. No |
| 3 | Which of these values is TRUTHY? | A. "False" |
| 4 | In which Python version was the match statement introduced? | D. 3.10 |
| 5 | marks = 72. In an if-elif ladder testing >= 90, >= 75, >= 60, >= 40 in order, which block runs? | C. >= 60 |
Chapter-6 | Loops
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | How many times does for i in range(2, 10, 2): execute its body? | B. 4 |
| 2 | Which statement skips the rest of the current iteration only? | A. continue |
| 3 | When is the else block of a for loop SKIPPED? | D. When the loop ends with break |
| 4 | What is the last value produced by range(10, 0, -3)? | B. 1 |
| 5 | What does the following print? i = 0; while i < 3: i += 1 – then print(i) | C. 3 |
Chapter-7 | Functions
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which keyword is used to define a function in Python? | B. def |
| 2 | Inside def f(*args):, what is the type of args? | A. tuple |
| 3 | What is printed by: def f(): pass – then print(f())? | D. None |
| 4 | What is the output of print((lambda x, y: x * y)(3, 4))? | C. 12 |
| 5 | Which keyword lets a function assign to a module-level variable? | A. global |
Chapter-8 | Lists
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What is the output of print([10, 20, 30, 40][-2])? | B. 30 |
| 2 | What does list.sort() return? | C. None |
| 3 | Which method removes and RETURNS the last item of a list? | A. pop() |
| 4 | What is the output of print([n for n in range(5) if n % 2])? | D. [1, 3] |
| 5 | a = [1, 2]; b = a; b.append(3). What is a? | B. [1, 2, 3] |
Chapter-9 | Tuples
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which of the following creates a tuple with ONE element? | C. (5,) |
| 2 | Which of these operations is NOT allowed on a tuple? | D. t.append(4) |
| 3 | What is the output of print((1, 2, 2, 3).count(2))? | A. 2 |
| 4 | After a, *b = (1, 2, 3), what is b? | B. [2, 3] |
| 5 | Which can be used as a dictionary key? | D. (1, 2) |
Chapter-10 | Dictionary
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What does {"a": 1}.get("b", 0) return? | C. 0 |
| 2 | Which of these can NOT be a dictionary key? | D. [1, 2] |
| 3 | d = {"x": 1}; d["x"] = 5. What is d? | A. {'x': 5} |
| 4 | Looping directly over a dictionary (for k in d) gives its: | B. Keys |
| 5 | Which method removes a key and returns its value? | D. pop() |
Chapter-11 | File System and Google Drive
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which mode erases existing content before writing? | D. w |
| 2 | Which is the default mode of open()? | A. r |
| 3 | Which method returns a LIST of lines? | C. readlines() |
| 4 | Opening an existing file in x mode raises: | B. FileExistsError |
| 5 | In Colab, Google Drive files appear under which path after mounting at /content/drive? | A. /content/drive/MyDrive |
NumPy Chapter-1 | Array Basics
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What is the shape of np.array([[1, 2, 3], [4, 5, 6]])? | C. (2, 3) |
| 2 | What is printed by print(np.array([1, 2]) * 3)? | A. [3 6] |
| 3 | What is the ndim of np.array(42)? | B. 0 |
| 4 | Which function includes the stop value by default? | D. np.linspace |
| 5 | What is the dtype of np.array([1, 2.5, 3])? | A. float64 |
NumPy Chapter-2 | Array Indexing
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | For arr = np.array([5, 10, 15, 20]), what is arr[-2]? | B. 15 |
| 2 | For m = np.array([[1, 2], [3, 4]]), what is m[1, 0]? | A. 3 |
| 3 | Which indexing style returns a COPY of the data? | D. arr[[0, 2]] |
| 4 | What does np.array([3, 8, 1])[np.array([3, 8, 1]) > 2] return? | A. [3 8] |
| 5 | Accessing arr[10] on a 3-element array raises: | C. IndexError |
NumPy Chapter-3 | Array Slicing
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What is np.array([1, 2, 3, 4, 5])[1:4]? | C. [2 3 4] |
| 2 | Which slice reverses an array? | A. arr[::-1] |
| 3 | For a 2-D array m, which expression gives the LAST column? | D. m[:, -1] |
| 4 | b = a[0:2]; b[0] = 50. What happens to a? | B. a[0] becomes 50 |
| 5 | What is the shape of m[1:2, :] for a 3 × 4 array? | C. (1, 4) |
NumPy Chapter-4 | Array Copy vs View
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which method creates an array that does NOT share data with the original? | B. copy() |
| 2 | For c = arr.copy(), what is c.base? | A. None |
| 3 | Which of these returns a COPY? | D. arr[[0, 1]] |
| 4 | Which function checks whether two arrays use the same memory? | C. np.shares_memory |
| 5 | v = arr.view(); arr[0] = 7. What is v[0]? | D. 7 |
NumPy Chapter-5 | Array Shape and Reshape
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | An array has 12 elements. Which reshape is INVALID? | C. (5, 2) |
| 2 | np.arange(8).reshape(2, -1).shape is: | A. (2, 4) |
| 3 | Which method ALWAYS returns a copy when flattening? | C. flatten() |
| 4 | What is the shape of the transpose of an array with shape (2, 5)? | D. (5, 2) |
| 5 | How many dimensions can be given as -1 in one reshape() call? | A. Only one |
NumPy Chapter-6 | Array Iterating
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Looping with for row in arr over a 2-D array gives each: | D. Row |
| 2 | Which function iterates over every element of an N-D array with ONE loop? | A. np.nditer |
| 3 | Which function yields (index, value) pairs? | C. np.ndenumerate |
| 4 | Which op_flags value allows nditer to modify elements? | B. "readwrite" |
| 5 | Why is (arr ** 2).sum() preferred over a Python loop for large arrays? | B. It is vectorised and much faster |
NumPy Chapter-7 | Array Join
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which function joins arrays along a NEW axis? | B. np.stack |
| 2 | Concatenating two (2, 3) arrays with axis=1 gives shape: | C. (2, 6) |
| 3 | np.vstack((np.array([1, 2]), np.array([3, 4]))) returns: | A. [[1 2] [3 4]] |
| 4 | np.hstack on two 1-D arrays of length 3 gives an array of shape: | D. (6,) |
| 5 | Which function joins along the third axis (depth)? | C. np.dstack |
NumPy Chapter-8 | Array Split
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which function can split 7 elements into 3 parts WITHOUT error? | C. np.array_split |
| 2 | np.split(np.arange(6), [2, 4]) returns how many arrays? | A. 3 |
| 3 | np.array_split returns a: | D. List of arrays |
| 4 | To split a 2-D array into column groups you use: | B. np.hsplit |
| 5 | np.array_split(np.arange(1, 8), 3)[0] is: | C. [1 2 3] |
NumPy Chapter-9 | Array Search
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | np.where(np.array([1, 5, 1]) == 1)[0] returns: | A. [0 2] |
| 2 | Which function performs a binary search on a sorted array? | D. np.searchsorted |
| 3 | np.searchsorted([10, 20, 30], 25) returns: | B. 2 |
| 4 | For np.array([3, 9, 9, 1]).argmax(), the result is: | C. 1 |
| 5 | Which function converts a flat index into (row, column)? | A. np.unravel_index |
NumPy Chapter-10 | Array Sort
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | What does arr.sort() return? | C. None |
| 2 | np.sort(np.array([True, False, True])) gives: | A. [False True True] |
| 3 | Which expression sorts an array in descending order? | B. np.sort(arr)[::-1] |
| 4 | np.array([30, 10, 20]).argsort() returns: | D. [1 2 0] |
| 5 | To sort every COLUMN of a 2-D array you use: | A. axis=0 |
NumPy Chapter-11 | Array Filter
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which operator means AND when combining NumPy conditions? | C. & |
| 2 | np.array([5, 15, 25])[np.array([5, 15, 25]) > 10] returns: | A. [15 25] |
| 3 | What does ~ do in a NumPy condition? | D. Inverts (NOT) the condition |
| 4 | Filtering a 2-D array with m[m > 10] returns an array with how many dimensions? | B. 1 |
| 5 | Which call replaces negative values with 0 and keeps others? | A. np.where(arr < 0, 0, arr) |
Pandas Chapter-1 | Pandas Basics
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which is the conventional way to import pandas? | A. import pandas as pd |
| 2 | A two-dimensional labelled table in pandas is called a: | C. DataFrame |
| 3 | pandas is built on top of which library? | B. NumPy |
| 4 | What does df.shape return for a table with 5 rows and 3 columns? | D. (5, 3) |
| 5 | Selecting a single column of a DataFrame returns a: | A. Series |
Pandas Chapter-2 | Pandas Series
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | pd.Series([5, 6, 7]).iloc[1] returns: | B. 6 |
| 2 | Which accessor uses LABELS and includes the slice end? | D. loc |
| 3 | When a Series is created from a dictionary, the keys become the: | A. Index labels |
| 4 | pd.Series([1, None, 3]).count() returns: | C. 2 |
| 5 | Adding two Series with partly different labels gives NaN for: | B. Labels present in only one Series |
Pandas Chapter-3 | Pandas DataFrame
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | df[["Name", "Age"]] returns a: | C. DataFrame |
| 2 | df.iloc[0, 1] selects: | A. First row, second column |
| 3 | Which expression filters students with Marks above 80? | D. df[df["Marks"] > 80] |
| 4 | df.loc[1:3] on a default integer index returns how many rows? | B. 3 |
| 5 | Which method removes a column? | A. df.drop(columns=[...]) |
Pandas Chapter-4 | CSV Files and DataFrames
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which function reads a CSV file into a DataFrame? | C. pd.read_csv() |
| 2 | How many rows does df.head() show by default? | A. 5 |
| 3 | Which option prevents the index from being written by to_csv()? | B. index=False |
| 4 | An empty cell in a numeric CSV column is read as: | D. NaN |
| 5 | Which method gives count, mean, std, min, quartiles and max? | C. describe() |