 Hey, what's up guys, Rudinal here, coming back at you with another Python tutorial. Let's fire up idle and see what we can do here. I'm going to create a new program, save this one as file.python, I'm going to create my shabang line here, usrbin, environmentpython, now we can create a new class, classbase, define our constructor here, make sure we get all the keywords spelled correctly, I'm going to test if this is the current script you're running, we can get started with an object, we are ready to roll. Now I'm going to create myself a string variable up here in the constructor for our new class, so self.string, I'm going to change mine to be a, this is a joke. Now I'm going to print this out, just so we get some output here, self.string, and we can incatenate on some new line characters as usual, and we get this as a joke, and just exactly what we were looking for. So now the function that I want to be talking to you guys about in this video today is called upper, and what this would do is it would convert every single lowercase letter inside your string to an uppercase letter, it's a lot like the lower function that we covered earlier, except it's changing everything to uppercase. So if we try this, we can do print self.string, remember it takes the name of your string variable, and then you can use your dot selector and then we can call upper, and now it doesn't take any parameters, but if we run this, we can see this is a joke, and all uppercase letters, like you're yelling at someone, this is a joke, and now we're going to try and recreate this all on our own. So I'm sure you guys can guess we're going to need the string module, so we can just go ahead and import that now, import string, and let's create a new function here, let's define, I'm going to call mine toUpper with an underscore, and pass itself, we're going to need the string to work with, and then we're going to need a, yeah, that's all, those are all the parameters that we need, because we don't need anything else. So now what we're going to need is the length of the alphabet, because we're going to be looping through it. Alphabet length can be the length, or the alien function, we can pass in the ASCII lowercase, importing or at least using that variable from the string module. Remember, you could pass in uppercase here, but as long as it's just an alphabet sort of thing. And now we're going to need a new string that we're going to be able to return our stuff with. So a new string can be blank for now, and let's start looping. We can do for character in string to work with, start up a code block. And now what we're going to do is test if the character is lowercase. So what we're going to do is test if it's inside that lowercase string, if character is in string dot ASCII lowercase, we get our code block started up here. And now what we're going to do is if it is, we can start looping through that lowercase, that lowercase string. So we're going to use our alphabet length here, and we're going to count through it for I in range alphabet length. Now we can test once more, if the string dot ASCII lowercase with the index I, so we get the current one that we're looking at. If that's equal to the character that we're looking at, what we can do is add that to new string, except we're going to want to put in the uppercase version of it. So string dot ASCII uppercase with the index of I. So if we find the lowercase characters, what we do is we find that index of where it is in the lowercase string, and we pass that same index to the uppercase string. So we'll get essentially that same letter, that same character, it'll just be uppercase. Now when we break out of this other else, I'm sorry, that this other if statement that we got here, if the character is not in string dot ASCII lowercase, if it's anything but a lowercase character, we're still going to want to add that to our string. So we can do else, and we can do a new string plus equals character. And then when we're done, when we're done looping, when we get out of everything, we can return the new string that we've created. New string. So let's go back up to our constructor. Let's try and run this. We'll do we can do print, we can do self dot to upper, and we can pass in the string that we've been working with self dot string. Now if we run this, we get this is a joke and all those capital letters just like we did in the previous function. Now if we change some things around about in the string, we can just change it to a string with a lowercase, we get string and then we get string and we still have our exclamation mark here because that's been added in. But anything that is uppercase will just be ignored when we're looping through it because we aren't testing for those. It'll just be added to the new string, regardless. So so there you go, guys. This is a pretty simple function. It's a lot similar to like that to lower function we were looking at earlier. In fact, it is. And it kind of goes along with that swap case function we were looking at in a previous video too. So these can be very helpful to to convert things to uppercase or lowercase. So if you're like trying to process user input, you'd be able to do this by at least knowing what they typed in because you get inverted to lower or something that you're able to predict or at least work with inside your code. So there you go, guys. I hope you enjoyed this. It'd be cool if you could like the video, maybe leave me a comment, let me know what you think and subscribe, maybe it's just an idea. But anyway, I'll see you guys in the next tutorial. Goodbye.