Explore topic-wise MCQs in Python.

This section includes 12 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the base case in the Merge Sort algorithm when it is solved recursively?

A. n=0
B. n=1
C. A list of length one
D. An empty list
Answer» D. An empty list
2.

In ____________________ copy, the modification done on one list affects the other list. In ____________________ copy, the modification done on one list does not affect the other list.

A. shallow, deep
B. memberwise, shallow
C. deep, shallow
D. deep, memberwise
Answer» B. memberwise, shallow
3.

What will be the output of the following Python code and state the type of copy that is depicted?

A. [2, 4, 6, 8], shallow copy
B. [2, 4, 6, 8], deep copy
C. [1, 2, 3], shallow copy
D. [1, 2, 3], deep copyView Answer
Answer» D. [1, 2, 3], deep copyView Answer
4.

The nested list undergoes shallow copy even when the list as a whole undergoes deep copy.

A. True
B. False
Answer» B. False
5.

In _______________ copy, the base address of the objects are copied. In _______________ copy, the base address of the objects are not copied.

A. deep. shallow
B. memberwise, shallow
C. shallow, deep
D. deep, memberwise
Answer» D. deep, memberwise
6.

Which type of copy is shown in the following python code?

A. Shallow copy
B. Deep copy
C. memberwise
D. All of the mentionedView Answer
Answer» B. Deep copy
7.

FALSE,_FALSE?$

A. False, True
B. True, True
C. True, False
Answer» D.
8.

True$

A. False
B. Error
C. Address of l1
Answer» D.
9.

[2, 4, 6, 8], shallow copy

A. [2, 4, 6, 8], deep copy
B. [1, 2, 3], shallow copy
C. [1, 2, 3], deep copy
Answer» D.
10.

In _______________ copy, the base address of the objects are copied.

A.
B. deep. shallow
C. memberwise, shallow
Answer» D.
11.

[88, 2, 3, [4, 5]]

A.
B. [2, 3, [4, 5]]
Answer» B. [2, 3, [4, 5]]
12.

Shallow copy

A. Deep copy
B. memberwise
C. All of the mentioned
Answer» C. All of the mentioned