Explore topic-wise MCQs in Python.

This section includes 3 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.

1.

Choose the function whose output can be: <_sre.SRE_Match object; span=(4, 8), match= aaaa >.

A. &gt;&gt;&gt; re.search( aaaa , alohaaaa , 0)
B. &gt;&gt;&gt; re.match( aaaa , alohaaaa , 0)
C. &gt;&gt;&gt; re.match( aaa , alohaaa , 0)
D. &gt;&gt;&gt; re.search( aaa , alohaaa , 0)
Answer» B. &gt;&gt;&gt; re.match( aaaa , alohaaaa , 0)
2.

________ matches the start of the string.
________ matches the end of the string.

A. ^ , $
B. $ , ^
C. $ , ?
D. ? , ^
Answer» B. $ , ^
3.

The character Dot (that is, . ) in the default mode, matches any character other than _____________

A. caret
B. ampersand
C. percentage symbol
D. newline
Answer» E.