MCQ Practice Single Best Answer Topic: Python RegEx Module MCQ

Q What will be the output after the following statements?
import re
x = re.compile(r'(Sun)?day')
y = x.search('Today is a nice day and a Sunday')
print(y.group())

Question ID
#4064
Subchapter
Python RegEx Module MCQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A day
  • B Today
  • C nice day
  • D Sunday
Correct Answer: A

Explanation

day

Share This Question

Share this MCQ with your friends or study group.