
python strings

Quiz
•
Professional Development
•
Professional Development
•
Hard
Assoc.Prof,IT Chennai
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following Python code snippet do?
string = "Hello, World!"
print(string.upper())
Prints “Hello, World!” in lowercase
Converts “Hello, World!” to uppercase and prints it
Reverses the string “Hello, World!”
Removes all whitespace characters from the string “Hello, World!”
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How can you concatenate two strings in Python?
Using the concat() method
Using the join() method
Using the & operator
Using the + operator
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following Python code snippet?
string = "Hello, World!"
print(string[3:7])
“Hello”
“lo, “
“lo, W”
“lo, World”
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which method is used to split a string into a list of substrings based on a delimiter in Python?
split()
substring()
separate()
divide()
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the strip() method do in Python string manipulation?
Removes all whitespace characters from both ends of the string
Removes all characters except alphabets from the string
Converts the string to uppercase
Converts the string to lowercase
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following Python code snippet?
string = "Hello, World!"
print(string.rjust(20))
” Hello, World!”
“Hello, World! “
” Hello, World! “
“Hello, World! “
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the isdigit() method do in Python string manipulation?
Checks if all characters in the string are digits
Converts the string to lowercase
Checks if all characters in the string are alphabets
Checks if the string is empty
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Basic 2 Python

Quiz
•
12th Grade - Professi...
10 questions
Python Functions

Quiz
•
Professional Development
11 questions
Python Libraries Series - Pandas

Quiz
•
Professional Development
14 questions
PYTHON BASICS

Quiz
•
Professional Development
10 questions
U 6 Top Notch 1

Quiz
•
Professional Development
10 questions
GREETINGS - FAREWELLS & INTRODUCING

Quiz
•
Professional Development
10 questions
C Structures

Quiz
•
Professional Development
10 questions
Day 5 - Data Type and Structur

Quiz
•
Professional Development
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