PCAP Strings Practice Question
Which TWO of the following string methods return a new string with all characters converted to lowercase? (Select exactly two.)
⚠ Common exam trap
Python Institute often tests the distinction between str.lower() and str.casefold() by presenting both as correct answers, trapping candidates who think casefold() only does lowercase conversion, when in fact it performs a more aggressive Unicode folding that also results in a lowercase string.
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
✓
str.lower()
Str.lower(), is correct because it returns a new string with all Unicode characters converted to lowercase according to the current locale's case mapping. Option E, str.casefold(), is correct because it returns a string suitable for case-insensitive comparisons by applying aggressive folding that handles special cases like the German 'ß' (which becomes 'ss'), going beyond simple lowercase conversion.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
str.title()
Why it's wrong here
str.title() does not qualify because it returns a new string with the first character of every word uppercased and all remaining characters lowercased, which is a transformation based on word boundaries, not a uniform case reduction. This method is therefore unsuitable for tasks that require a consistent, locale-independent lowercase mapping, and its output length and character content can differ from the original in ways unrelated to simple case folding.
- ✗
str.swapcase()
Why it's wrong here
str.swapcase() is not correct because it returns a new string where each uppercase character becomes lowercase and each lowercase character becomes uppercase, effectively inverting the case of every letter while leaving non-alphabetic characters unchanged. This operation is symmetrical and does not produce a normalized lowercase form, so it fails the requirement of converting a string to lowercase for comparison or storage.
- ✗
str.capitalize()
Why it's wrong here
str.capitalize() is also wrong because it returns a new string with only the very first character converted to uppercase and every other character converted to lowercase, which changes case in a positional, non-uniform manner. It does not guarantee that the entire string is lowercase, and it can introduce an uppercase character where there was none, making it unsuitable for case-insensitive normalization.
- ✓
str.lower()
Why this is correct
str.lower() is a correct answer because it returns a new string in which every Unicode character that has a lowercase mapping is converted to its lowercase equivalent, while characters without a case mapping remain unchanged. This method performs a simple, one-to-one lowercase conversion that is sufficient for many case-insensitive comparisons and is the standard way to normalize text to lowercase.
- ✓
str.casefold()
Why this is correct
str.casefold() is technically correct as a lowercase-like transformation, but it is more aggressive than str.lower() because it applies Unicode case folding, which can map multiple characters to a single character (e.g., the German 'ß' folds to 'ss') and removes certain case distinctions that str.lower() preserves. While casefold is designed for caseless matching, the question likely expects the simpler and more commonly cited method, str.lower(), as the correct answer; casefold changes the string more radically and is not always a pure lowercase conversion.
Go deeper
Related to this question
About these practice questions
This PCAP question is part of Courseiva's 421-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.