 Hey, what's going on guys? RudeLunnel here coming back at you with another Python tutorial Let's fire up idle and get to programming. I'm gonna create a new window here save this as a file.python We can get our shebang line started usr bin environment Python class base Holy goodness so much code. It's almost Uncomprehensible is that even a word? I don't know Uncomprehensible yeah, I think it's incomprehensible. That's right. Yeah, whatever. I don't know. I only speak Python That's all that's the only language. I know I Feel like Python is like parcel tongue. Haha. You get that joke. That's a good joke, isn't it? All right, anyway, let's go. Let's create ourselves a string variable here self dot string can be this is a joke Jome let's call it a joke. All right now the function We're gonna be taking a look at today is similar to the left justify that we looked at a few videos back today We're gonna be checking out right justify So this is if we do if we try it with the built-in function self dot string We can change it to our just we can call it We're gonna want to pass in the width or how much it is that we're justifying it by so before we do this We can print out self dot string so we get the original and let's concatenate on here some new line characters and we can print out The self string that's justified and we'll pass in like 30 as a width So let's run this and we have this is a joke right up top And then we have this is a joke with the width of 30 and we have the spaces here And now we can change we can also pass in a fill character So we just don't have spaces here, and let's try those those Plus signs like we were doing in the last tutorial to run this and now we have all of these So let's see how we can do this and try and recreate this in our own function if we comment this out right up here Let's define a new function inside of our class Let's call this one our right justify We can just be self and we need string to justify make sure you spell everything right We're gonna have width and then we can set up the fill character This is looking familiar isn't it? Let's start up a code block and now we can test if the length The length of the fill character It's greater than one Then we better Change it to a single character rather than being a string so fill character can equal Fill character at the beginning and so the index we can index that that first bit And now we can test out a difference a difference is going to be our integer variable. It's going to be width minus let's see the String to justify or the length of the string that that we're justifying so width minus length of string to justify That'll be our difference and now what we'll do is we'll return Fill character this we can have this inside prime that sees as opposed So we have a little bit of an expression here fill character multiplied by difference and then we can add on string to justify Now if you remember in the last tutorial what we did is we returned string to justify And we added on the fill times difference at the end in our case We wanted the front though because we're right justifying now. We aren't left justifying so if we uncomment this and we We call our function inside of our constructor we can do print self dot write justify We can pass in self dot string and we'll give it a width of 30 so we can run this and we have this as a joke and Justified in that 30 character long string just like we have right up here And we can set this up with the plus sign if we wanted to because we remember we can pass in a fill character So it's passing our 30. I'm sorry our plus sign and we get the same thing now if we put this alongside the original function The built-in one we have the exact same out But because we've done practically the same the same thing here, and you know it gets the job done. It looks good It's almost everything that we did in the last tutorial we were left justifying But at this time we're putting the field character right before the string that we're outputting. So so there you go guys It's pretty simple. I hope you enjoyed this. I hope you this is understandable You can comprehend this with a without a problem, but hey Thank you for listening and thank you for watching and I will see you in the next tutorial