String Formatting

In this lesson, we will learn about formatting strings in Python

We'll cover the following

String formatting (AKA substitution) is the topic of substituting values into a base string. Most of the time, you will be inserting strings within strings; however you will also find yourself inserting integers and floats into strings quite often as well. There are two different ways to accomplish this task. We’ll start with the old way of doing things and then move on to the new.

Ye Olde Way of Substituting Strings

The easiest way to learn how to do this is to see a few examples. So here we go:

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy