PCAP Strings Practice Question
Given s = 'Python', which THREE of the following expressions evaluate to True? (Choose three.)
⚠ Common exam trap
The PCAP exam often tests the case-sensitivity of string methods and operators, trapping candidates who forget that `in`, indexing, and comparison methods like `isupper()` are case-sensitive and that `istitle()` requires the first letter of each word to be uppercase and all subsequent letters lowercase.
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
✓
'th' in s
The `in` operator checks for substring membership, and 'th' is indeed a contiguous substring within the string 'Python'. Python's `in` operator performs a linear scan of the string to determine if the substring exists, returning True if found.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
'th' in s
Why this is correct
The `in` operator performs a substring membership test, returning `True` when the literal characters `'th'` appear consecutively anywhere within `s`. In `'Python'`, the substring `'th'` is found at indices 2–3 (the third and fourth characters), so this expression evaluates to `True`. Note that substring matching is case-sensitive and does not require word boundaries.
- ✗
s[0] == 'p'
Why it's wrong here
String indexing is zero-based, so `s[0]` returns the first character of `'Python'`, which is the uppercase letter `'P'`. The comparison then checks whether `'P'` equals `'p'`, but Python string equality is case-sensitive, so the two distinct characters make the expression evaluate to `False`. This option confuses uppercase and lowercase versions of the same letter.
- ✗
s.isupper()
Why it's wrong here
The `str.isupper()` method returns `True` only if every cased character in the string is uppercase and the string contains at least one cased character. In `'Python'`, the first character `'P'` is uppercase, but the remaining five characters `'y'`, `'t'`, `'h'`, `'o'`, `'n'` are lowercase, so the method returns `False`. It is not checking whether the string contains any capital letter.
- ✓
s.isalpha()
Why this is correct
The `str.isalpha()` method returns `True` when all characters in the string are alphabetic and the string is non-empty. Each character in `'Python'` — `P`, `y`, `t`, `h`, `o`, `n` — belongs to a Unicode letter category, and there are no digits, spaces, or punctuation marks, so the method returns `True`. Note that this is a valid correct answer because the question asks which expressions will evaluate to a true value.
- ✓
s.istitle()
Why this is correct
The `str.istitle()` method returns `True` if the string is in titlecase: each word begins with an uppercase character and the remaining characters in that word are lowercase, with at least one cased character present. `'Python'` is a single word starting with capital `P` followed by lowercase `ython`, satisfying this rule exactly, so the method returns `True`. It does not require multiple words, and it is case-sensitive about the initial letter.
Go deeper
Related to this question
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 →
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.