 What is going on guys? Root of the Null here coming back at you with some more Python tutorials. Let's get idle started up and we can see what we can do here. Create a new script as always. File.python. See if this says user bin environment. Python class base. Define initializer self. We can set a string here. What should it be? This is a joke. This is like last time and then we can set up a conditional statement. Test if this is the current script we are running. Root equals base. Okay, so now let's take a look at what we're going to be working with today. There is a string function that is out there called lower. And what this will do is convert all the uppercase letters inside your string to the lowercase letters. So let's try it. Let's print out self.string.lower. Before we do that we can print out the original self.string and we can compare. This is a joke and then that's the way our string is set up to begin with. And then when we call the function this is a joke with a lowercase t. So if we had some more capital letters in here it still converts all of them in there. So let's try and recreate this all on our own. We're going to want to import the string module because we're going to be working with some of those uppercase and lowercase letters. And we can change this to lower to find a new function here. Self.string.toChange. And then we can get a code block started and we can go and begin to loop through it. So for item in or at least for character that might be a better name for our variable. And the character in the string change, our code block started. We can, we can test if that character is in their membership operator is in string.asky uppercase. So this will test if it's an uppercase letter. If it is we can begin to loop through it and we're going to want to get the range. So first of all let's set a length variable outside of the for loop so we don't have to repeatedly set that. Uppercase length can be length of string.asky uppercase. And now for I in range at string.asky uppercase. Actually no we want to use uppercase length. I'm sorry we just set that variable and that's why we need it. So we can count through string.asky uppercase and if... Let's see string to change I is equal to asky dot, no string.asky sorry. String.asky lowercase and we're going to index it with our current I variable. And the string to change actually should be character. And I'll make this window a little bit bigger so you can see all the code that we're typing here. So if the current variable is something that we find inside the lowercase variable list then we can change it. String to change character can be set to what we found. That actually won't make any sense because if we're changing the string to change character that's going to be the uppercase one. We should change it to... Let's take this through a little bit more. For the I in range uppercase length so we're looping through the uppercase letters and if when we get it, if uppercase character is equal to lowercase I we should change that to uppercase I so this is going to be the uppercase variable then our current variable that we're looking for should be asky dot lowercase I. So we can do string to change character because the current character that we're looking at in the string and we can change that to string dot asky lowercase indexed with I and that will likely still give us a problem because I don't think you can change values inside of a string. But let's try it anyway. We'll change string to change and we can close this and we can print self dot to lower. We can pass in our string and let's see if we get any errors. And of course we do. String indices must be integers not strings. Character. Oh I see, I see. If the character is equal to the uppercase I we can test that. String object does not support item assignment. Okay so we can't change the value that we need here but we can create a new string. First of all new string will be blank and every time we find something in the string that we're looking through we can add to it. And we can add to the new string. For the character and string to change we're going to want, if it's uppercase we can change it. New string add on the current character that we're looking at and if not we can add on the lowercase version. New string plus equals string ascii lowercase. So we run this now. This is a joke, this is a joke. So this isn't going to work for us just yet because we need to change back new string. That makes sense here. This is a joke and we've converted it to this is a joke. Awesome. So what we've done here is we've created a new string variable and that's going to be our filler string or the current one that we're going to look with. And for each character that we find inside the string that's been passed to us, so in our case this is a joke. If the character is an uppercase letter then we're going to loop through our uppercase character's array or our list in this case. And we're going to keep checking for the index and whether the index or not is the same as the character that we're looking at in the uppercase variable. We can use that index to retrieve the lowercase version of it. So then we add that to the new string so we're just adding on the lowercase version of the letter. If it's something that we don't find as an uppercase letter we can just add it back on. So if it's a lowercase letter we don't have to worry about it we can add it. If it's a space character we don't have to worry about it we can just add it. If it's an exclamation point we don't have to worry about it we can just add it. And that's how it works. It'll only process things that it finds as an uppercase letter because we're testing if the character that we're looking at is inside that ASCII uppercase string or that list. It depends on however you want to look at it but it's still an iterable object. Iteratable or object. We can still loop through the string because we'd be able to loop through it just like anything like a list or a tuple or that sort of thing. We can loop through it with our in membership operator. So there you go. I'm sorry about the flops in this video guys but this is the way we can get the job done. We can print out the original self.string.lower and we can use our new function self.toolower and we can pass in our string. It's still going to convert the current string to a lowercase version. If we had this it'll print out the way it should. If we had this with the capital T-H-I it'll convert this all to lowercase. If we had some spaces in there maybe a dot dot dot and we added those it's still going to convert all the things that we need to be looking at the uppercase to lowercase letters. So there you go guys. Here is how or at least here is another way of converting all your uppercase letters in your string to a lowercase variable a lowercase letter and remember we're using the string module here so we can create this all on our own just by manually typing in each letter or we could actually just use the ASCII table and that makes things a whole lot easier on our end. So thank you guys for watching. I hope you enjoyed this and I'll see you in the next tutorial. Bye.