Python-Quizzes | Miscellaneous | Question 11

import re
re.findall(r’\bm[a-z]*’, ‘its not mango, its mongo man’1)

(A) [‘mango’,’mongo’,’man’]
(B) [‘its’, ‘mango’, ‘mongo’]
(C) [‘its’,’not’,’mango’,’mongo’,’man’]
(D) [‘man’,’mongo’,’mango’]


Answer: (A)

Explanation: ‘\b’ matches the empty string, but only at the beginning or end of a word. m[a-z]* matches every word starting with ‘m’ in the sentence.

Quiz of this Question
Please comment below if you find anything wrong in the above post


GATE CS Notes (According to Official GATE 2017 Syllabus)

GATE CS Corner


See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.