Search Header Logo

String Methods Quiz

Authored by Monika Agrawal

Computers

11th Grade

Used 1+ times

String Methods Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to convert a string to all lowercase letters?

lower()

toLower()

convert()

downcase()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `strip()` method do?

Removes all spaces from the string

Removes leading and trailing whitespace

Converts the string to uppercase

Reverses the string

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method can be used to find the index of a substring in a string?

index()

find()

locate()

position()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? text = "Hello, World!" print(text.replace("World", "Python"))

Hello, Python!

Hello, World!

Hello, World

Hello, Python

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to check if a string starts with a specified substring?

startwith()

beginswith()

startswith()

isstart()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `split()` method do?

Combines two strings

Splits a string into a list based on a delimiter

Joins a list into a string

Reverses the string

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? my_string = "Python" print(my_string[1:4])

Pyt

yth

tho

Pyth

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?