Search Header Logo

Quiz2

Authored by Alok Sahoo

Computers

University

Used 4+ times

Quiz2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the regex pattern `[a-zA-Z]{3,}` match?

Exactly 3 letters

At least 3 letters (only lowercase)

At least 3 letters (both cases)

Exactly 3 uppercase letters

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which regex pattern matches a valid 10-digit mobile number at the end of a sentence?

'\d{10}$'

'\d{10}'

`^\d{10}`

`\d{10}\b

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will `re.findall(r'[+*/-]|\w+', '12 15+3 100-*')` return?

['12', '15', '+', '3', '100', '-', '*']

['12', '+', '3', '*']

['+', '-', '*']

['12', '15+3', '100-*']

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the regex pattern `(\w+) \1` do?

Matches two different words

Matches the same word repeated

Matches any character

Throws an error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does `re.sub(r'(\w+) \1', r'\1', 'go go gone')` return?

'go gone'

'gone'

'go go gone'

'go gone gone'

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does `re.I` flag do?

Enables indentation

Ignores whitespace

Enables case-insensitive matching

Enables multi-line matching

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you match a literal dash `-` in a character class?

Put it at the start or end like `[-abc]`

. Escape it like `[a\-c]`

Both A and B

You can't match dash using character class

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?