Which of the following methods would you use to convert a string to all uppercase letters in Python?
Mastering Python String Techniques

Quiz
•
Computers
•
9th - 12th Grade
•
Easy
Christopher Martin
Used 17+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
`str.uppercase()`
`str.toUpperCase()`
`str.upper()`
`str.capitalize()`
2.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What will be the output of the following code snippet? ```python s = "Hello, World!" print(s[7:12]) ```
`World`
`World!`
`ello,`
`Hello`
3.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
Which of the following is a valid way to find the position of a substring within a string in Python?
`str.find(substring)`
`str.indexOf(substring)`
`str.search(substring)`
`str.locate(substring)`
4.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What will be the result of the following code? ```python s = "Python" print(s[::-1]) ```
`nohtyP`
`Python`
`nohty`
`Pytho`
5.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
Which of the following methods can be used to remove whitespace from the beginning and end of a string?
`str.strip()`
`str.trim()`
`str.clean()`
`str.remove()`
6.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What will be the output of the following code snippet? ```python s = "banana" print(s.count('a')) ```
`1`
`2`
`3`
`4`
7.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
Which of the following is a correct way to concatenate two strings, `s1` and `s2`, in Python?
`s1 + s2`
`s1.concat(s2)`
`s1 & s2`
`s1.append(s2)`
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
python-BTxâu

Quiz
•
9th - 12th Grade
10 questions
STRING HANDLING

Quiz
•
10th Grade
10 questions
10 câu kiểu xâu tiết 1

Quiz
•
11th Grade
10 questions
Символьные величины 9 класс

Quiz
•
9th Grade
11 questions
KIỂU XÂU - PYTHON

Quiz
•
10th Grade
15 questions
Chapter 8 String Manipulations

Quiz
•
12th Grade
10 questions
Unit 1 Post Test: Basic Python

Quiz
•
9th - 12th Grade
10 questions
Bài 24-Xâu kí tự

Quiz
•
10th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade