Exercise 9: Manual Title Case — Possible Solution ==================================================================== sentence = "the quick brown fox" result = "" for i, ch in enumerate(sentence): if i == 0 or sentence[i - 1] == " ": result += ch.upper() else: result += ch print(result) Output: The Quick Brown Fox WHY THIS WORKS AS AN ANSWER ------------------------------ This is the exercise the index half of enumerate() actually earns its keep for — i == 0 catches the very first character of the whole string (which has no character before it to check), and sentence[i - 1] == " " catches every character that comes immediately after a space, which is exactly the definition of "the first letter of a word" once the very first word is already handled by the i == 0 case. Every other character falls into the else branch and gets appended unchanged — including the space characters themselves. A space is only ever preceded by a letter in this sentence, never by another space, so sentence[i - 1] == " " is False when i points at a space, and it falls straight into the else branch and gets copied across untouched, exactly as it should be.