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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!