Search Header Logo

RE_Lambda_Comprehension

Authored by Lilesh Pathe

Computers

Professional Development

Used 1+ times

RE_Lambda_Comprehension
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the regular expression r"\d+" match?

A single digit

One or more digits

Any non-digit

Only letters

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What function is used to check if a regex pattern matches at the beginning of a string?

re.match()

re.findall()

re.sub()

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does re.findall(r"[A-Z]", "Hello World!") return?

['Hello', 'World']

['H', 'W']

['e', 'o']

[]

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which character matches any single character in regex?

*

?

.

^

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does re.sub(r"\s", "_", "Python is fun") return?

'Python_is_fun'

'Python is fun'

'Python_is_fun_'

'Python_isfun'

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which regex pattern matches a valid email address?

r"[a-z]+@[a-z]+\.[a-z]+"

r"\d+@\d+\.\d+"

r"\w+\.\w+"

r"[A-Z]+@[A-Z]+"

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of re.match(r"py", "python").group()?

'py'

'python'

'pyt'

Error

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?