String Data Type(Python)
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Namal (ITNamal)
Used 3+ times
FREE Resource
Enhance your content in a minute
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()
Access all questions and much more by creating a free account
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
15 questions
Attacks Threats & Vulnerabilities (C1)
Quiz
•
9th - 12th Grade
15 questions
Unbound Report Quiz
Quiz
•
9th - 12th Grade
20 questions
Python básico
Quiz
•
9th - 12th Grade
20 questions
A Level CS - 06 Boolean Algebra & Logic Gates
Quiz
•
11th - 12th Grade
20 questions
REMEDI PAS - DESAIN DAN KOMP. GRAFIS
Quiz
•
12th Grade
15 questions
After Effect Intoduction
Quiz
•
10th Grade - University
20 questions
Google SketchUp Tool
Quiz
•
KG - University
22 questions
Steve Jobs
Quiz
•
6th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
