> ## Documentation Index
> Fetch the complete documentation index at: https://python-training.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Module 9: Strings

> Build, slice, transform, and format strings, from escape sequences to f-strings.

| | |
| - | - |
| **Exam** | PCEP-30-03 |
| **Section** | 3. Data Collections: Lists, Tuples, Sets, Dictionaries, and Strings (26% of the exam) |
| **Objectives** | 3.5.1, 3.5.2, and 3.5.3 |
| **Exam questions** | About 3, one per objective |

By the end of this module you can do everything below. The objectives and their wording come from the [official PCEP-30-03 syllabus](https://pythoninstitute.org/pcep-exam-syllabus).

## 3.5.1 Construct strings and access their contents

* Create strings using single quotation marks, double quotation marks, and triple quotation marks.
* Use escape sequences introduced by the backslash character.
* Include quotation marks and apostrophes inside string literals.
* Create multiline strings.
* Access characters using positive and negative indexes.
* Extract substrings using slicing.
* Use slice start, stop, and step values with strings.
* Explain string immutability.
* Determine the length of a string using the `len()` function.
* Use the `in` and `not in` operators to test whether a substring is present.

## 3.5.2 Process and transform strings

* Change letter case using `lower()`, `upper()`, `capitalize()`, `title()`, and `swapcase()`.
* Search for characters or substrings using `find()`.
* Split strings into substrings using `split()`.
* Join multiple strings using `join()`.
* Remove whitespace or selected characters from string boundaries using `strip()`, `lstrip()`, and `rstrip()`.
* Replace selected characters or substrings using `replace()`.
* Recognize that string methods return new strings rather than modifying the original string.

## 3.5.3 Format values as strings

* Construct formatted string literals using f-strings.
* Insert variables and expressions into f-string replacement fields enclosed in `{}`.
* Recognize basic formatting performed using the `format()` method.
* Recognize basic legacy string formatting performed using the `%` operator.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.