Practice Python Strings MCQs with Answers Set 01 provided below. The MCQ Questions for [current-page:node:field_class] Strings [current-page:node:field_subject] with answers and follow the latest [current-page:node:field_board]/ NCERT and KVS patterns. Refer to more Chapter-wise MCQs for [current-page:node:field_board] [current-page:node:field_class] [current-page:node:field_subject] and also download more latest study material for all subjects
MCQ for [current-page:node:field_class] [current-page:node:field_subject] Strings
[current-page:node:field_class] [current-page:node:field_subject] students should review the 50 questions and answers to strengthen understanding of core concepts in Strings
Strings MCQ Questions [current-page:node:field_class] [current-page:node:field_subject] with Answers
Question. What will be the output of the following Python statement?
1. \(>>>"a"+"bc"\)
(a) a
(b) bc
(c) bca
(d) abc
Answer: d
Explanation: + operator is concatenation operator.
Question. What will be the output of the following Python statement?
1. \(>>>"abcd"[2:]\)
(a) a
(b) ab
(c) cd
(d) dc
Answer: c
Explanation: Slice operation is performed on string.
Question. The output of executing string.ascii_letters can also be achieved by:
(a) string.ascii_lowercase_string.digits
(b) string.ascii_lowercase+string.ascii_upercase
(c) string.letters
(d) string.lowercase_string.upercase
Answer: b
Explanation: Execute in shell and check.
Question. What will be the output of the following Python code?
1. >>> str1 = 'hello'
2. >>> str2 = ','
3. >>> str3 = 'world'
4. >>> \(str1[-1:]\)
(a) olleh
(b) hello
(c) h
(d) o
Answer: d
Explanation: -1 corresponds to the last index.
Question. What arithmetic operators cannot be used with strings?
(a) +
(b) *
(c) –
(d) All of the mentioned
Answer: c
Explanation: + is used to concatenate and * is used to multiply strings.
Question. What will be the output of the following Python code?
1. >>>print \((r"\nhello")\)
(a) a new line and hello
(b) \nhello
(c) the letter r and then hello
(d) error
Answer: b
Explanation: When prefixed with the letter ‘r’ or ‘R’ a string literal becomes a raw string and the escape sequences such as \n are not converted.
Question. What will be the output of the following Python statement?
1. >>>print('new' 'line')
(a) Error
(b) Output equivalent to print ‘new\nline’
(c) newline
(d) new line
Answer: c
Explanation: String literal separated by whitespace are allowed. They are concatenated.
Question. What will be the output of the following Python statement?
1. >>> print('x\97\x98')
(a) Error
(b) 97
98
(c) x\97
(d) \x97\x98
Answer: c
Explanation: \x is an escape sequence that means the following 2 digits are a hexadecimal number encoding a character.
Question. What will be the output of the following Python code?
1. >>>str1="helloworld"
2. >>>\(str1[::-1]\)
(a) dlrowolleh
(b) hello
(c) world
(d) helloworld
Answer: a
Explanation: Execute in shell to verify.
Question. print(0xA + 0xB + 0xC):
(a) 0xA0xB0xC
(b) Error
(c) 0x22
(d) 33
Answer: d
Explanation: 0xA and 0xB and 0xC are hexadecimal integer literals representing the decimal values 10, 11 and 12 respectively. There sum is 33.
Question. What will be the output of the following Python code?
1. class father:
2. def __init__(self, param):
3. self.o1 = param
4.
5. class child(father):
6. def __init__(self, param):
7. self.o2 = param
8.
9. >>>obj = child(22)
10.>>>print "%d %d" % (obj.o1, obj.o2)
(a) None None
(b) None 22
(c) 22 None
(d) Error is generated
Answer: d
Explanation: self.o1 was never created.
Question. What will be the output of the following Python code?
1. class tester:
2. def __init__(self, id):
3. self.id = str(id)
4. id="224"
5.
6. >>>temp = tester(12)
7. >>>print(temp.id)
(a) 224
(b) Error
(c) 12
(d) None
Answer: c
Explanation: Id in this case will be the attribute of the class.
Question. What will be the output of the following Python code?
1. >>>example = "snow world"
2. >>>print("%s" % \(example[4:7]\))
(a) wo
(b) world
(c) sn
(d) rl
Answer: a
Explanation: Execute in the shell and verify.
Question. What will be the output of the following Python code?
1. >>>example = "snow world"
2. >>>\(example[3] = 's'\)
3. >>>print example
(a) snow
(b) snow world
(c) Error
(d) snos world
Answer: c
Explanation: Strings cannot be modified.
Question. What will be the output of the following Python code?
1. >>>max("what are you")
(a) error
(b) u
(c) t
(d) y
Answer: d
Explanation: Max returns the character with the highest ascii value.
Question. Given a string example=”hello” what is the output of example.count(‘l’)?
(a) 2
(b) 1
(c) None
(d) 0
Answer: a
Explanation: l occurs twice in hello.
Question. What will be the output of the following Python code?
1. >>>example = "helle"
2. >>>example.find("e")
(a) Error
(b) -1
(c) 1
(d) 0
Answer: c
Explanation: Returns lowest index.
Question. What will be the output of the following Python code?
1. >>>example = "helle"
2. >>>example.rfind("e")
(a) -1
(b) 4
(c) 3
(d) 1
Answer: b
Explanation: Returns highest index.
Question. What will be the output of the following Python code?
1. >>>example="helloworld"
2. >>>\(example[::-1]\).startswith("d")
(a) dlrowolleh
(b) True
(c) -1
(d) None
Answer: b
Explanation: Starts with checks if the given string starts with the parameter that is passed.
Question. To concatenate two strings to a third what statements are applicable?
(a) s3 = s1 . s2
(b) s3 = s1.add(s2)
(c) s3 = s1.__add__(s2)
(d) s3 = s1 * s2
Answer: c
Explanation: __add__ is another method that can be used for concatenation.
Question. What will be the output of the following Python statement?
1. >>>chr(ord('A'))
(a) A
(b) B
(c) a
(d) Error
Answer: a
Explanation: Execute in shell to verify.
Question. What will be the output of the following Python statement?
1. >>>print(chr(ord('b')+1))
(a) a
(b) b
(c) c
(d) A
Answer: c
Explanation: Execute in the shell to verify.
Question. Which of the following statement prints hello\example\test.txt?
(a) print(“hello\example\test.txt”)
(b) print(“hello\\example\\test.txt”)
(c) print(“hello\”example\”test.txt”)
(d) print(“hello”\example”\test.txt”)
Answer: b
Explanation: \is used to indicate that the next \ is not an escape sequence.
Question. Suppose s is “\t\tWorld\n”, what is s.strip()?
(a) \t\tWorld\n
(b) \t\tWorld\n
(c) \t\tWORLD\n
(d) World
Answer: d
Explanation: Execute help(string.strip) to find details.
Question. The format function, when applied on a string returns ___________
(a) Error
(b) int
(c) bool
(d) str
Answer: d
Explanation: Format function returns a string.
Question. What will be the output of the “hello” +1+2+3?
(a) hello123
(b) hello
(c) Error
(d) hello6
Answer: c
Explanation: Cannot concatenate str and int objects.
Question. What will be the output of the following Python code?
1. >>>print("D", end = ' ')
2. >>>print("C", end = ' ')
3. >>>print("B", end = ' ')
4. >>>print("A", end = ' ')
(a) DCBA
(b) A, B, C, D
(c) D C B A
(d) D, C, B, A will be displayed on four lines
Answer: c
Explanation: Execute in the shell.
Question. What will be the output of the following Python statement?(python 3.xx)
1. >>>print(format("Welcome", "10s"), end = '#')
2. >>>print(format(111, "4d"), end = '#')
3. >>>print(format(924.656, "3.2f"))
(a) Welcome# 111#924.66
(b) Welcome#111#924.66
(c) Welcome#111#.66
(d) Welcome # 111#924.66
Answer: d
Explanation: Execute in the shell to verify.
Question. What will be displayed by print(ord(‘b’) – ord(‘a’))?
(a) 0
(b) 1
(c) -1
(d) 2
Answer: b
Explanation: ASCII value of b is one more than a. Hence the output of this code is 98-97, which is equal to 1.
Question. Say s=”hello” what will be the return value of type(s)?
(a) int
(b) bool
(c) str
(d) String
Answer: c
Explanation: str is used to represent strings in python.
MCQs for Strings [current-page:node:field_subject] [current-page:node:field_class]
Students can use these MCQs for Strings to quickly test their knowledge of the chapter. These multiple-choice questions have been designed as per the latest syllabus for [current-page:node:field_class] [current-page:node:field_subject] released by [current-page:node:field_board]. Our expert teachers suggest that you should practice daily and solving these objective questions of Strings to understand the important concepts and better marks in your school tests.
Strings NCERT Based Objective Questions
Our expert teachers have designed these [current-page:node:field_subject] MCQs based on the official NCERT book for [current-page:node:field_class]. We have identified all questions from the most important topics that are always asked in exams. After solving these, please compare your choices with our provided answers. For better understanding of Strings, you should also refer to our NCERT solutions for [current-page:node:field_class] [current-page:node:field_subject] created by our team.
Online Practice and Revision for Strings [current-page:node:field_subject]
To prepare for your exams you should also take the [current-page:node:field_class] [current-page:node:field_subject] MCQ Test for this chapter on our website. This will help you improve your speed and accuracy and its also free for you. Regular revision of these [current-page:node:field_subject] topics will make you an expert in all important chapters of your course.
FAQs
You can get most exhaustive Python Strings MCQs with Answers Set 01 for free on StudiesToday.com. These MCQs for are updated for the 2026-27 academic session as per examination standards.
Yes, our Python Strings MCQs with Answers Set 01 include the latest type of questions, such as Assertion-Reasoning and Case-based MCQs. 50% of the paper is now competency-based.
By solving our Python Strings MCQs with Answers Set 01, students can improve their accuracy and speed which is important as objective questions provide a chance to secure 100% marks in the .
Yes, MCQs for have answer key and brief explanations to help students understand logic behind the correct option as its important for 2026 competency-focused exams.
Yes, you can also access online interactive tests for Python Strings MCQs with Answers Set 01 on StudiesToday.com as they provide instant answers and score to help you track your progress in .