15 extra multiple-choice questions for Strings and String manipulation (12th Standard Computer Science, Samacheer Kalvi), beyond the ones printed in the textbook — each with the correct option highlighted and a clear, worked explanation. Free to read in English and Tamil.
Q1
If a string in Python is defined as my_str = "Innovate", what will be the value returned by my_str[-5]?
- A. "o"Correct
- B. "n"
- C. "v"
- D. "a"
Explanation. Negative indexing starts from the end of the string with -1. Counting backwards from the last character 'e' (-1) to the fourth character 'o' gives the index of -5.
Q2
Which built-in Python string function is used to change the case of every character in a string to its opposite case?
- A. inversecase()
- B. togglecase()
- C. swapcase()Correct
- D. reversecase()
Explanation. The swapcase() function is a built-in Python string function that toggles uppercase characters to lowercase and vice versa for all characters.
Q3
What will be the output of the following Python expression: print("Python".center(10, '*'))?
- A. "**Python**"Correct
- B. "*Python***"
- C. "***Python*"
- D. "****Python"
Explanation. The center() function pads the string with the specified fill character on both sides to reach the total width, distributing characters as evenly as possible.
Q4
Which of the following is returned by the expression print("Save1Earth".isalnum()) in Python?
- A. False
- B. TrueCorrect
- C. None
- D. Error
Explanation. The isalnum() method returns True if all characters in the string are alphanumeric (alphabets or digits) and there are no spaces or special characters.
Q5
In Python, what occurs when you attempt to delete a single character from a string using the statement: del str1?
- A. The character at index 2 is replaced with a blank space
- B. The character at index 2 is removed and the string is resized
- C. It throws a TypeError because strings are immutableCorrect
- D. It throws a NameError because the variable is deleted
Explanation. Strings are immutable in Python. Deleting individual characters using indexing is not supported and results in a TypeError.
Q6
What will be the output of the following Python code snippet?
str1 = "Welcome to Python"
print(str1[11:17:2])
- A. "Pto"Correct
- B. "Pth"
- C. "yhn"
- D. "Pyn"
Explanation. The slice extracts characters from index 11 ('P') up to 17 with a stride of 2, retrieving 'P', 't', and 'o' to form 'Pto'.
Q7
Which of the following formatting characters is used to represent a signed decimal integer in Python string formatting?
- A. %c
- B. %dCorrect
- C. %s
- D. %f
Explanation. The formatting character %d (or %i) is used in Python to represent signed decimal integers when formatting strings.
Q8
What will be the output of the following Python code?
str1 = "corporation"
print(str1.capitalize())
- A. "Corporation"Correct
- B. "CORPORATION"
- C. "corporation"
- D. "CorporatioN"
Explanation. The capitalize() function converts only the first character of the string to uppercase, keeping all other characters lowercase.
Q9
Which of the following values is returned by the find() function if the specified substring is not found within the main string?
- A. 0
- B. False
- C. None
- D. -1Correct
Explanation. The find() method returns the start index of the first occurrence of the substring. If it cannot find the substring, it returns -1.
Q10
What will be the output of the following Python code snippet?
str1 = "Raja Chozhan"
print(str1.count('a', 0, 5))
- A. 1
- B. 2Correct
- C. 3
- D. 4
Explanation. The slice from 0 to 5 covers 'Raja '. Within this range, the character 'a' appears at indices 1 and 3, yielding a count of 2.
Q11
What will be the output of the following Python code snippet?
str1 = "welcome"
print(str1.islower())
- A. TrueCorrect
- B. False
- C. None
- D. Error
Explanation. The islower() method returns True if all alphabetic characters in the string are in lowercase, which is true for 'welcome'.
Q12
What is the output of the functions ord('A') and chr(65) in Python respectively?
- A. 65 and "A"Correct
- B. "A" and 65
- C. 97 and "a"
- D. "a" and 97
Explanation. The ord() function returns the ASCII value of a character (65 for 'A'), whereas chr() returns the character for an ASCII code (A for 65).
Q13
Which of the following escape sequences represents an ASCII Carriage Return in Python?
- A. \n
- B. \t
- C. \rCorrect
- D. \b
Explanation. The escape sequence \r represents a Carriage Return, whereas \n represents a Linefeed and \t represents a Horizontal Tab.
Q14
What is the result of the membership operation "chennai" in "Chennai Schools" in Python?
- A. True
- B. FalseCorrect
- C. Error
- D. None
Explanation. String membership tests in Python are case-sensitive. Since 'chennai' has a lowercase 'c' and the target string has 'C', it returns False.
Q15
What is the output of the following Python code?
print("welcome" + "python" * 2)
- A. "welcomepythonwelcomepython"
- B. "welcomepythonpython"Correct
- C. "welcomewelcomepython"
- D. "welcomepython2"
Explanation. The repetition operator * has higher precedence than concatenation +. Thus, 'python' * 2 is executed first to get 'pythonpython', then concatenated.
About these Strings and String manipulation questions
These are the Additional multiple-choice questions for Strings and String manipulation from the Tamil Nadu State Board (Samacheer Kalvi) 12th Standard Computer Science syllabus. Each question shows the correct option and an original, step-by-step explanation so you understand the method, not just the answer. Use the answer key above to jump to any question, then take the practice test to check yourself under exam-like conditions.
Frequently asked questions
How many MCQs are there in Strings and String manipulation?
This chapter has 15 book-back multiple-choice questions, each with the correct answer and a step-by-step explanation.
Are these 12th Standard Computer Science MCQs free to practise online?
Yes. Every question, answer and explanation here is free, and you can also take them as a timed practice test.
Where can I find the Strings and String manipulation book-back answers?
The correct option for each question is highlighted on this page with a worked explanation, plus a quick answer-key summary at the top.