Examveda

What is the output of the following code:
import re
result = re.sub(r's', '-', 'This is a test.')
print(result)

A. This-is-a-test.

B. An error will occur

C. This--is--a--test.

D. This- is a test.

Answer: Option A


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

Join The Discussion

Related Questions on Regular Expressions in Python