ExamVeda
Login
Home
31
What will be the output of the following Python code?
re.escape('new**world')
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
32
Which of the following functions results in case insensitive matching?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
33
Which of the following will result in an error?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
34
The expression a{5} will match . . . . . . . . characters with the previous regular expression.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
35
What is the purpose of the re.VERBOSE flag in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
What will be the output of the following Python code?
m = re.search('a', 'The blue umbrella')
m.re.pattern
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
37
What will be the output of the following Python code?
sentence = 'horses are fast'
regex = re.compile('(?P<animal>\w+) (?P<verb>\w+) (?P<adjective>\w+)')
matched = re.search(regex, sentence)
print(matched.groupdict())
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
38
What will be the output of the following Python code?
re.match('sp(.*)am', 'spam')
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
39
How can you specify a range of characters in a character class in regular expressions?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
40
What will be the output of the following Python function?
re.findall("hello world", "hello", 1)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board