Vidyalelo
Python · Q79

Regular Expressions in Python

Programming · Python · question 79

Q79

What will be the output of the following Python code? sentence = 'we are humans' matched = re.match(r'(.*) (.*?) (.*)', sentence) print(matched.groups())

A.
('we', 'are', 'humans')
Answer
B.
(we, are, humans)
C.
('we', 'humans')
D.
'we are humans'

Answer: Option A

Solution

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