From the course: Advanced Python

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

String formatting

String formatting - Python Tutorial

From the course: Advanced Python

String formatting

- [Instructor] Python provides a high degree of control over string formatting. And there's a few different ways to accomplish this. So the functions I'm going to be covering are here in the documentation at these links. The first link is to the Python built-in types. And if we scroll down a little bit over here in the nav bar and we click on the String Methods link here, you can see that there's quite a few built-in, string-related functions. And the second link is to the string module, which contains information about the string formatting specification, which is right here, which we'll get to a bit later. And we saw this module a little bit earlier in a previous video. So I suggest keeping each of these open as we go through the example, and you can refer to them if you feel like trying some of your own code and experiments out. So first, let's take a look at some of the basic string formatting functions. So here in my example code, let's take a look at some simple examples first…

Contents