ExamVeda
Login
Home
61
What is the output of the following code:
import re
result = re.sub(r's', '-', 'This is a test.')
print(result)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
62
What will be the output of the following Python code?
sentence = 'we are humans'
matched = re.match(r'(.*) (.*?) (.*)', sentence)
print(matched.group())
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
63
Which of the following functions does not accept any argument?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
64
How can you match either of two patterns in regular expressions using the | operator?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
65
What is the purpose of the re.search() function in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
66
What will be the output of the following Python code?
re.findall('good', 'good is good')
re.findall('good', 'bad is good')
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
67
How can you match the end of a string using regular expressions?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
68
What will be the output of the following Python code?
re.fullmatch('hello', 'hello world')
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
69
What will be the output of the following Python code?
a=re.compile('[0-9]+')
a.findall('7 apples and 3 mangoes')
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
70
The function of re.match is . . . . . . . .
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board