Five wonderful uses of ‘f- Strings’ in Python

Parul Pandey
Towards Data Science
4 min readJan 25, 2021

--

Photo by Paul Volkmer on Unsplash

Before PEP 498 was introduced, Python had primarily three ways of formatting strings i.e. the %-formatting, str.format and the string.Template. In 2015, Eric V. Smith proposed a new string formatting mechanism known as Literal String Interpolation, which provided a simpler and effective way for formatting strings. These strings are referred to as formatted string literal or f-strings as they are prefixed with…

--

--

Principal Data Scientist @H2O.ai | Author of Machine Learning for High-Risk Applications