Examveda

What will be the output of the following code:
import re
pattern = re.compile(r'd+')
result = pattern.search('There are 5 apples and 3 oranges.')
print(result.group())

A. 5

B. An error will occur

C. 3

D. ['5', '3']

Answer: Option D


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

Join The Discussion

Related Questions on Regular Expressions in Python