 Ladies and gentlemen, what is going on? Root from NullShow.com here with you guys again today, bringing you back with some more Python tutorials. Let's get idle fired up here and let's see what we can do. I'm gonna create a new script. Call this one file.python. We'll get a shebang line started. Create a new class. I finally did it. I finally created this entire skeleton program without typing into anything wrong. Any errors? That's awesome! Look at that dude! That's great! Alright, let's get on with the tutorial. What I'm gonna do here is create a new string variable. Call this one self.string. I'm just gonna put in here string. The value of this string is just gonna be plain old string to keep it easy. The function I want to show you guys today is called a zfill. Before we get started with that, let's print out our string and let's concatenate on here some new line characters. This is what we're working with. We're just working with plain old string. Now, if we look at zfill, we can do self.string and we can dot zfill. What zfill does is that you can pass a width to it. What it will do is it will try and increase the length of the current string that you've passed to it, or the string that you're calling it with. It'll try and increase it to this length 20 by adding in zeros to the left of it. It's kind of a strange function. But if we run this, you can see what I mean. It adds all these zeros to it and string to equal a width of 20. So let's try and recreate this all on our own. It's actually incredibly simple. Like, you will kind of be surprised. We spent more time writing the skeleton code rather than we're going to do writing the function. Let's define this. Define a zfill. Can use self.string.width. And now what we're going to do right off the bat is return zero times the width minus the length of the string plus the string. And then we're done. Now, I mean, if we go put this up on our constructor, if we do print, let's see, self.zfill and we pass in our string here, self.string. We pass in 20. We're going to get the exact same output. So now see what we're doing here is we're adding zero. We're adding all these zeros. But what we're doing is first we're finding the width and then we subtract the length of the string. So if we have 20 and we have six, we can do 20 minus six and we get 14. So then we have 14 zeros because zero times 14 is going to give us anyway those 14 zeros. And then we add on the original string. So now this can work even if our width that we pass is less than the size of the string. If we do four and we do four right up here, we're still going to get the original string value. So this one is real simple. I think we've kind of looked at this idea before and we made it a little bit more complex. But now here it is in the bare bones. This is all the function does. It's very simple. I don't see anywhere where you would ever use this function, but hey, it's in the Python language. So let's try and see how we can create this on our own. And here it is. It's a one-liner. So thank you guys for watching. I hope you enjoyed this quick and easy tutorial and I will see you in the next video. Goodbye.