String Methods Quiz

String Methods Quiz

11th Grade

10 Qs

quiz-placeholder

Similar activities

Python Codehs

Python Codehs

7th - 12th Grade

10 Qs

Introduction to Python Review

Introduction to Python Review

9th - 12th Grade

11 Qs

Python Quiz

Python Quiz

9th Grade - Professional Development

10 Qs

แบบทดสอบก่อน-หลังเรียน

แบบทดสอบก่อน-หลังเรียน

9th - 12th Grade

10 Qs

PYTHON 1

PYTHON 1

11th - 12th Grade

10 Qs

Python - Chpt 3 - Review

Python - Chpt 3 - Review

9th - 12th Grade

15 Qs

python basics

python basics

11th Grade - University

15 Qs

Chapter 1 Python

Chapter 1 Python

8th Grade - University

12 Qs

String Methods Quiz

String Methods Quiz

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Monika Agrawal

Used 1+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?