Question
1.Consider the following Python statement: matches = re.search(r'[a-z]oo[a-z]*', The food is good) The variable matches is: a list a match object a tuple a string
1.Consider the following Python statement: matches = re.search(r'[a-z]oo[a-z]*', "The food is good") The variable "matches" is: a list a match object a tuple a string
2. What is the output of the following segment of code?
s = "We are humans"
m = re.match(r'(.*) (.*?) (.*)', s)
print (m.group(2))
'are' | ||
'we' | ||
'humans' | ||
'we are humans' |
3. In the functions re.search.start(group) and re.search.end(group), if the argument group is not specified, it defaults to ______________
A. | Zero | |
B. | None | |
C. | One | |
D. | Error |
4.
Choose the option wherein the two choices do not refer to the same option
A. | re.I re.IGNORECASE | |
B. | re.M re.MULTILINE | |
C. | re.X re.VERBOSE | |
D. | re.L re.LOWERCASE
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started