Vidyalelo
Python · Q71

Regular Expressions in Python

Programming · Python · question 71

Q71

What will be the output of the following Python code? import re s = "A new day" m = re.match(r'(.*)(.*?)', s) print(m.group(2)) print(m.group(0))

A.
No output
A new day
Answer
B.
No output
No output
C.
[‘A’, ‘new’, ‘day’]
(‘A’, ‘new’, ‘day’)
D.
Error
[‘A’, ‘new’, ‘day’]

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board