PCAP Strings Practice Question
Which THREE of the following are true about Python strings?
⚠ Common exam trap
Python Institute often tests the immutability of strings by presenting operations that appear to modify them in place, leading candidates to incorrectly select 'mutable' because they confuse string methods (like .replace() or .upper()) with in-place mutation.
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
✓
They support slicing.
Python strings are sequences, and the slicing syntax (e.g., s[start:stop:step]) allows extracting substrings by specifying indices. This works because strings implement the sequence protocol, including __getitem__ with slice objects.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
They support slicing.
Why this is correct
Slicing is supported because strings are sequences: using the notation s[start:stop:step] you can extract a contiguous substring or even a reversed copy. The result is always a new string object, since the original cannot be modified in place, and the slice can use negative indices to count from the end, such as s[-3:] taking the last three characters.
- ✗
They are stored as arrays of ASCII characters.
Why it's wrong here
This is incorrect for Python 3, where strings are stored as sequences of Unicode code points, not as ASCII characters. Every character, whether it is 'a' or '€', is represented by its Unicode code point, which may require one or more bytes when encoded into UTF-8 or another encoding. ASCII is only a small subset of Unicode, so restricting storage to ASCII would make it impossible to represent the vast range of characters Python 3 strings support.
- ✓
They can be concatenated with the + operator.
Why this is correct
Concatenation with + is a fundamental string operation that creates a new string by joining the right operand to the end of the left operand. The operator requires both operands to be strings; attempting to concatenate a string with an integer raises a TypeError, which is why explicit conversion with str() is often necessary. Because strings are immutable, every concatenation allocates a new string object, so using + in a loop can be inefficient compared to joining with ''.join() or using a list.
- ✗
They are mutable.
Why it's wrong here
This is false because strings are immutable in Python: once a string object is created, its characters cannot be changed in place. Any operation that appears to modify a string, such as s.replace('a', 'b') or s.upper(), actually builds and returns a new string while the original remains unchanged. Attempting to assign to an index, like s[0] = 'x', raises a TypeError, and the immutability of strings is what makes them safe to use as dictionary keys and hashable objects.
- ✓
They support indexing.
Why this is correct
Indexing is supported because strings are ordered sequences: you can access a single character using square brackets with a zero-based index, for example s[0] returns the first character. Negative indices are also allowed, so s[-1] gives the last character. The result of indexing is always a new string of length 1, since Python does not have a distinct character type, and the index must be within the valid range or an IndexError is raised.
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.