Examveda
Examveda

What is the output of the following code:
import re
result = re.sub(r'd+', 'number', 'There are 5 apples and 3 oranges.')
print(result)

A. There are number apples and number oranges.

B. An error will occur

C. There are 5 apples and 3 oranges.

D. There are number apples and 3 oranges.

Answer: Option A


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

Join The Discussion

Related Questions on Regular Expressions in Python