Courseiva
Strings →mediumMultiple Choice

PCAP Strings Practice Question

What does the expression 'hello world'.title() return?

⚠ Common exam trap

Python Institute often tests the distinction between `title()`, `capitalize()`, and `upper()` by presenting strings where only one word is capitalized, leading candidates to confuse the behavior of these methods.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

'Hello World'

The `title()` method in Python returns a copy of the string where the first character of each word is converted to uppercase and all remaining characters are converted to lowercase. For the string 'hello world', this results in 'Hello World', making option A correct.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    'Hello World'

    Why this is correct

    'Hello World' is the exact return value of 'hello world'.title(): the title() method scans the string and, for each whitespace-delimited word, converts its first character to uppercase while converting any remaining characters to lowercase. Since both original words are already lowercase, each word becomes capitalized, yielding 'Hello World'.

  • ✗

    'HELLO WORLD'

    Why it's wrong here

    'HELLO WORLD' would result from calling upper() on 'hello world', not title(). The title() method never uppercases every letter; it only uppercases the initial character of each word and lowercases the rest of that word. Therefore, with all-lowercase input, title() produces mixed case 'Hello World', not an all-caps string.

  • ✗

    'Hello world'

    Why it's wrong here

    'Hello world' shows only the first word capitalized, which is the behavior of capitalize(), not title(). The title() method identifies each whitespace-separated word and capitalizes its first letter, so the second word 'world' must also start with an uppercase 'W'. Leaving 'world' lowercase means only part of the transformation was applied.

  • ✗

    'hello World'

    Why it's wrong here

    'hello World' incorrectly keeps the first word lowercase while capitalizing only the second. title() applies the same capitalization rule uniformly across every word in the string: the first word 'hello' must become 'Hello' just as 'world' becomes 'World'. A result that capitalizes only the second word violates title()'s per-word uppercasing mechanism.

About these practice questions

One of 421 original PCAP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCAP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCAP exam.