
String Methods Quiz

Quiz
•
Computers
•
11th Grade
•
Hard
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
Similar Resources on Wayground
15 questions
Progamming - Java Syntax

Quiz
•
11th - 12th Grade
11 questions
Python Intro 1

Quiz
•
7th - 12th Grade
10 questions
Mastering Python String Techniques

Quiz
•
9th - 12th Grade
9 questions
Python Basics Quiz for KS3

Quiz
•
11th Grade - University
10 questions
PF Unit 10

Quiz
•
9th Grade - University
13 questions
Python Operators & Expressions

Quiz
•
8th - 11th Grade
10 questions
Python Basics Quiz

Quiz
•
7th Grade - University
10 questions
Python Data types

Quiz
•
5th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade