CHAPTER 7

image

Strings

Given the fundamental nature of strings in all forms of programming, it should come as no surprise that Python’s string features can fill an entire chapter. Whether it’s interacting with users by way of keyboard input, sending content over the Web, analyzing the great American novel, or participating in a Turing test,1 strings can and are used for many applications.

With all this emphasis on strings, Python makes sure to include a wide variety of features to support them. Some of these features are built right into the string objects themselves, while others are provided by modules in the standard library and many third-party ...

Get Pro Python, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.