String Data Type(Python)

Quiz
•
Computers
•
12th Grade
•
Hard
Namal (ITNamal)
Used 3+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
s = "Python"
print(s[1:4])
a) 'ytho'
b) 'Pyt'
c) 'yth'
d) 'tho'
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
s = "hello"
print(s.capitalize())
a) 'HELLO'
b) 'Hello'
c) 'hELLO'
d) 'hello'
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following methods would you use to convert all characters in a string to lowercase?
a) toLowerCase()
b) lowercase()
c) lower()
d) to_lower()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
s = "Hello, World!"
print(s.split(","))
a) ['Hello', 'World!']
b) ['Hello', ' World!']
c) ['Hello, ', 'World!']
d) ['Hello', 'World']
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you concatenate two strings, 'str1' and 'str2', in Python?
a) str1.concat(str2)
b) str1 + str2
c) str1.append(str2)
d) str1 & str2
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following code?
s = "Python"
print(s[-1])
a) P
b) o
c) n
d) h
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method would you use to remove whitespace from the beginning and end of a string?
a) strip()
b) trim()
c) remove()
d) delete()
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Python Built-in Functions

Quiz
•
11th - 12th Grade
18 questions
Kiểu dữ liệu xâu kí tự trong Python

Quiz
•
10th Grade - University
15 questions
Problem Solving using Python and R - UNIT I STRINGS MCQS

Quiz
•
12th Grade
15 questions
Grade 8 End of Unit Revision

Quiz
•
8th Grade - University
15 questions
Programming python review

Quiz
•
9th - 12th Grade
18 questions
Final Test Python Code

Quiz
•
9th - 12th Grade
20 questions
Python String

Quiz
•
12th Grade
15 questions
Control Python Bàsic.

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade