ADITYA CODING CLUB
Aditya College of Engineering, Madanapalle
Python Programming Test- 13
1.Test Contains 10 Questions
2. All Questions are asked from Regular Expression
3. Each Question Carries 1 Mark
Roll Number *
Type your Full Roll Number( Eg: 208P1A0565)
Name *
Type your Name
DEPARTMENT *
Year *
Required
Section *
1. Which module in Python supports regular expressions? *
1 point
2.  Which of the following creates a pattern object? *
1 point
3.   What does the function re.match do? *
1 point
4.    What does the function re.search do? *
1 point
5.  What will be the output of the following Python code?
sentence = 'we are humans' matched = re.match(r'(.*) (.*?) (.*)', sentence) print(matched.groups())
*
1 point

6. What will be the output of the following Python code?

sentence = 'we are humans'

matched = re.match(r'(.*) (.*?) (.*)', sentence) print(matched.group())  

*
1 point

7. What will be the output of the following Python code?

sentence = 'we are humans' matched = re.match(r'(.*) (.*?) (.*)', sentence) print(matched.group(2))

*
1 point

8. 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())

*
1 point

9. 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.groups())

*
1 point

10. 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.group(2))

*
1 point
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy