This Python String Quiz provides Multiple Choice Questions (MCQs) to help you get familiar with Python Strings. To perform any programming tasks in Python, a good understanding of string manipulation is necessary. This online quiz focuses on testing your skills in Python String manipulation.
You’ll encounter questions covering:
- String Creation and Basics: How to define strings, basic properties like length, and immutability.
- String Indexing and Slicing: Accessing specific characters or substrings using indices and slicing techniques.
- String Methods: Utilizing built-in string methods for common operations like changing case, searching, replacing, splitting, and joining strings.
- String Formatting: Different ways to embed variables and expressions within strings.
- Escape Sequences: Understanding special characters within strings.
Also, See:
- Python String Exercise
- 15 Python Quizzes: each focusing on a specific topic
- The quiz contains 25 questions. There is no time limit.
- Explanation is provided for each answer.
- You will get 1 point for each correct answer. Solve 15 correctly to pass the test

Awesome Learning Website
how can I know my score in quize ? i all ready perticipate in 2 quizes , after submitting the answers i can not able to see my score , please help me Sir
similar issue I am also facing. After multiple attempts I am unable to see the results. Pls guide us…
The problem has been resolved. Sorry for the inconvenience.
how can I know my score in quize ? i all ready perticipate in 2 quizes , after submitting the answers i can not able to see my score , please help me Sir
myString = “pynative”
myString_ = “pynative”
##stringList = [“abc”, “pynative”, “xyz”]
stringList = [“abc”, myString_, “xyz”]
print(stringList[1] == myString)
print(stringList[1] is myString)
print(“id(stringList[1]),id(myString)”,id(stringList[1]),id(myString))
print(“id(stringList[1])==id(myString)”,id(stringList[1])==id(myString))
# # True
# # True
# # id(stringList[1]),id(myString) 4301687006784 4301687006784
# # id(stringList[1])==id(myString) True
its nice
Thanks for the quizzes. Here’s a suggested fix.
ord(‘char’)
should be
ord(‘c’)
or
ord(‘char'[:1])
The reason is that ord() is the right function to get the ASCII code of a character, but ‘char’ is a bad argument for it, since ord() expects a string of length 1.
Thanks for creating the exercise and adding the explanations!
As a beginner, I found it challenging.
yes i am also beginner but it was a fun for me that a good teacher meet me on youtube and he teach it in very easy way and i didn’t find it difficult
The answer is correct but please expand explanation for q1.
Although it should be “True, False” because intuition will tell you that both object should be at different memory location. Some edge case where program is small python will optimize code to save myString and stringList[1] to same memory location. Despite being initialized differently.
Sir Question No.8 sajhme nhi aa rha h syad question me mistake h ya hume samjh me nhi aaya . APP explain kr dijiye plz
In ques 8 both are pointing to word pynative, though pynative is in a list in stringList
please explain Q 14
the isalnum() method returns true if all characters in the string are either number or alphabets..thus space is not one’em sot he answer is False
that code is checking in a string is it fully digits or none
title() make every first letter capital and capitalize() make only first letter of sentence capital.
Few remarks : adding the date for comments would really be helpful to know if the code is still up-to-date
And some questions are still missing a bit of description!
Really cool test, thanks! Your exercices on python strings were really helpful aswell.
can you plz add a collumm in which we add our code and it by executing explains us error in that box
eg – print(str1[3:], “and ”, str1[:2])
Very helpful site, but explanations for certain answers are not provided.
Hey Shayeri, I will add that
Hello, Q11 should have “Welcome To The Beautiful World Of Python” as result not “Welcome To The Beautiful World of Python”. All the world are capitalized, even of
Sorry, it is Q4, not Q11
Hi, it is Q12 now…. ok they are randomly generated 🙂
By the way, the issue is that one I reported 🙂
Thank you
P.S.: really good site, that’s why I’m reporting issues 😉
Hey Giorgio, I have updated the reported question. I really appreciate your time and effort in letting me know the suggestions.
Hey Giorgio, I have updated the question. Thank you.
For Q12, I am getting 6 as answer.
Thanks for informing me. I have updated the correct answer now.
Q.13