Formatting Strings with the Python Template Class
Introduction Python Templates are used to substitute data into strings. With Templates, we gain a heavily customizable interface for string substitution (or string interpolation). Python already offers many ways to substitute strings, including the recently introduced f-Strings. While it is less common to substitute strings with Templates, its power lies in how we can customize our string formatting rules. In this article, we’ll format strings with Python’s Template class. We’ll then have a look at how we can change the […]
Read more