The standard library’s string module provides many useful string-related functions. Here are some examples to give you a sense of the module.
When you run this program, you’ll get:
In Python, many of these operations are methods on string objects rather than standalone functions. The in operator is used for checking if a substring is contained in a string. The string module provides additional string constants and functions, but for basic string operations, Python’s built-in string methods are typically used.