Question
1. What is the regular expression for matching any character that is NOT the letter A? a. [^a] b. [!a] c. [^A] d. [!A] 2.
1. What is the regular expression for matching any character that is NOT the letter A?
a. | [^a] | |
b. | [!a] | |
c. | [^A] | |
d. | [!A] |
2.
Which of the following Unix utilities do not take regular expressions as argument?
a. | grep | |
b. | egrep | |
c. | fgrep | |
d. | sed |
3.
The metacharacters \< and \> are used as anchors to respectively match
a. | the beginning and end of a line | |
b. | the beginning and end of a word | |
c. | the beginning and end of a list | |
d. | the beginning and end of a regular expression pattern |
4.
Within a regular expression, the metacharacter [[:alpha:]] matches
a. | any character | |
b. | whitespace | |
c. | uppercase and lowercase letters | |
d. | any word |
5.
What does the following code display?
name = 'Zoe'
print(name.lower())
print(name.upper())
print(name)
6.
What will the following code display?
dct = {'Monday':1, 'Tuesday':2, 'Wednesday':3}
print(dct.get('Thursday', 'Not Found'))
7.
After the following code executes, what elements will be members of set3?
set1 = set([10, 20, 30, 40])
set2 = set([40, 50, 60])
set3 = set1.union(set2)
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