Examveda

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')

B. (we, are, humans)

C. ('we', 'humans')

D. 'we are humans'

Answer: Option A


This Question Belongs to Python Program >> Regular Expressions In Python

Join The Discussion

Related Questions on Regular Expressions in Python