Explore topic-wise MCQs in Python.

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

1.

The difference between the functions re.sub and re.subn is that re.sub returns a _______________ whereas re.subn returns a __________________

A. string, list
B. list, tuple
C. string, tuple
D. tuple, list
Answer» D. tuple, list
2.

The function re.error raises an exception if a particular string contains no match for the given pattern.

A. True
B. False
Answer» C.