
Understanding Strings in Python
Quiz
•
Mathematics
•
University
•
Practice Problem
•
Medium
Van Khanh
Used 1+ times
FREE Resource
Enhance your content in a minute
82 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid string declaration?
string = "Hello"
string = 'Hello'
string = """Hello"""
All of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you get the length of a string s?
len(s)
length(s)
s.length()
size(s)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method converts all characters of a string to uppercase?
toUpper()
upper()
to_upper()
upcase()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of "hello".capitalize()?
HELLO
hello
Hello
Hello World
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is used to concatenate strings in Python?
+
&
concat()
append()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does s[::-1] do?
Reverses the string s
Returns the first character of s
Returns the last character of s
Rotates the string s
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you check if a string s contains only digits?
s.isdigit()
s.isnumeric()
s.isalpha()
s.isalnum()
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
