Mastering Python String Formatting

String Formatting in Python

Sadrach Pierre, Ph.D.
Towards Data Science
3 min readDec 6, 2020

--

Photo by Chris F. on Pexels

Python offers a variety of methods for string formatting. In this post, we will review three methods for formatting strings in python. Specifically, we will discuss %-formatting, str.format() and formatting strings with f-strings.

Let’s get started!

Formatting Strings with %

--

--

Writer for Built In & Towards Data Science. Cornell University Ph. D. in Chemical Physics.