Q2
1 markMCQSection A

Identify the output of the following code snippet :

``python

s = "the Truth"

print(s.capitalize())

``

Review of Python Basics (Class XI Recap)
String Methods — capitalize()

Options

(A)The truth
(B)THE TRUTH
(C)The Truth
(D)the Truth
Official Answer

Option A — The truth is the correct output, because str.capitalize() converts only the first character of the string to uppercase and forces every other character to lowercase.

capitalize()string methodscase conversionPython string functionsuppercaselowercase

Marking Scheme

  • 11 mark: for correctly selecting option A (`The truth`).

Hint

capitalize() makes ONLY the first letter uppercase and forces everything else to lowercase.

Quick Oral Answer

capitalize() uppercases only the first character of the string and lowercases all the rest, so 'the Truth'.capitalize() gives 'The truth'.

Analysis & Explanation

The capitalize() method has a specific two-part behaviour that many students overlook.


Concept

  • capitalize() converts the first character of the string to uppercase.
  • It also converts all remaining characters to lowercase, regardless of their original case.
  • Applied to "the Truth": first char tT; remaining he Truthhe truth (the capital T in Truth is forced to lowercase).
  • Result: "The truth".

Why other options are wrong

  • Option B (THE TRUTH) — this would be the result of .upper(), not .capitalize().
  • Option C (The Truth) — wrongly assumes only the first letter changes and the rest of the string is left untouched; but capitalize() lowercases everything else too.
  • Option D (the Truth) — this is the unchanged original string; it ignores that capitalize() does modify the first character.

Exam trap

  • Students confuse capitalize() (only first char upper, rest lower) with title() (every word's first letter upper).

Common Mistakes

  1. 1Confusing capitalize() with title(), which capitalizes the first letter of every word.
  2. 2Assuming capitalize() only affects the first letter and leaves the rest of the string unchanged.

Interesting Facts

Python string methods like capitalize(), upper(), lower() always return a NEW string — strings are immutable, so the original string s remains unchanged.

capitalize() was designed to match natural sentence casing, which is why it forces the rest of the string to lowercase, unlike title().

Spotted a mistake or something unclear?

Tell us — we fix reported answers fast.

Frequently Asked Questions

What is the difference between capitalize() and title() in Python?

capitalize() uppercases only the first character of the entire string and lowercases the rest; title() uppercases the first letter of every word in the string. For 'the truth of life', capitalize() gives 'The truth of life' while title() gives 'The Truth Of Life'.

Does capitalize() modify the original string?

No. Strings are immutable in Python, so capitalize() returns a new string; the original string remains unchanged unless reassigned.