ExamVeda
Login
Home
21
The function re.error raises an exception if a particular string contains no match for the given pattern.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
22
What will be the output of the following Python code?
re.split('\W+', 'Hello, hello, hello.')
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
23
. . . . . . . . matches the start of the string.
. . . . . . . . matches the end of the string.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
24
What is the output of the following code:
import re
result = re.search(r'd{2}', 'There are 25 apples and 3 oranges.')
print(result.group())
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
What will be the output of the following Python code?
re.compile('hello', re.X)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
26
What will be the output of the following Python code?
re.subn('A', 'X', 'AAAAAA', count=4)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
27
What is the purpose of the re.findall() function in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
28
Which of the following functions clears the regular expression cache?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
29
What will be the output of the following Python code?
re.split(r'\s+', 'Chrome is better than explorer', maxspilt=3)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
30
What will be the output of the following Python code?
import re
re.ASCII
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board