Vidyalelo
Python · Q61

Regular Expressions in Python

Programming · Python · question 61

Q61

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

A.
This-is-a-test.
Answer
B.
An error will occur
C.
This--is--a--test.
D.
This- is a test.

Answer: Option A

Solution

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