CHAPTER 9
Working with Text
In this chapter, you learn how to use Python to work with text, which Python handles as strings of characters. You start by learning the essentials of strings and then perform essential moves with strings, such as returning part of a string; concatenating multiple strings into a single string; searching for specific values; and building strings using the interpolation operator, using the .format method, using f-strings, and using template strings.

Learn the Essentials of Strings
Return Information About a String
Transform and Clean Up a String
Return Part of a String via Slicing
Concatenate and Repeat Strings
Search for One String Inside Another String
Check and Change String Capitalization
Meet Python’s Tools for Building Strings
Build Strings with the Interpolation Operator
Learn the Essentials of Strings
In this section, you learn the essentials of strings: with what strings are in Python, how you create single-line strings and multiline strings, and the tools that Python provides for working with strings. You also learn a little about character codes and character sets, the symbols that computers use to represent text — and emoji — on the screen.
Understanding What ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access