
Understanding Strings in Python

Quiz
•
Mathematics
•
University
•
Medium
Van Khanh
Used 1+ times
FREE Resource
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
Similar Resources on Wayground
80 questions
Unit 6-8 Vocabulary

Quiz
•
7th Grade - University
85 questions
untitled

Quiz
•
6th Grade - University
80 questions
UAE Coordinates

Quiz
•
4th Grade - University
82 questions
Major Assessment #1: Functions Overview

Quiz
•
12th Grade - University
77 questions
Identify Parts of Expressions and PEMDAS

Quiz
•
8th Grade - University
77 questions
Quiz

Quiz
•
7th Grade - University
80 questions
TABE D Math Test2

Quiz
•
6th Grade - University
77 questions
hahaha

Quiz
•
University
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade