 Hey, what's going on guys ruling out here coming back at you with another Python tutorial? Let's fire up idle and let's get to programming. I'm gonna create a new script here save this as a File.python Josh a bang line started. Oh Man, I'm doing good. Oh, dude. I'm not gonna screw up this time. Oh, oh I typed in C instead of D And I would type in a colon a semi-colon. Holy crap All right, whatever whatever there's the time will come when I go flawless My name look at this. I think I jinxed myself All right, whatever Mother of God. Okay. Okay. Here we go. Let's get our string variable here, and that's exactly what we're gonna be working with today We're gonna be working with strings as always. This is a string isn't it So now what we're gonna be talking about today is something called the string at least It's a built-in a string function That checks whether the entire string is full of alphabetical characters So all this let's check it. Let's take a look at it right now. Let's print out Self.string is alpha and this is means it's going to return a Boolean variable And if alpha means it's if it's full of alphabetical characters So if it's full of any letters and that's all so let's run this we get false because we have spaces in here We have this exclamation point. We have this quotation mark We have this uh, we have this question mark. So if we just filled this with the word string It'll run true because all of them are letters But if we had a space in there it gives a problem if we have an exclamation point It has a problem if we have a question mark problem if we have a quotation mark problem So you get the idea. It's only returning letters and it could be any letter It could be a capital or lowercase letter if we had Strong strong whatever and that's true because these are still capital letters So let's take a look at a new module today though It's going to import string and string is full of if we go in our interactive shell here We can check it out with the autocomplete feature string is full of all these interesting things that we can use and Some of them are still things that we would be able to do with the just a regular built-in string But this module gives us some extra content that we can work with like remember at a video Few few series a few videos back. We had been grabbing the ASCII letters Like uppercase and lowercase letters We can do this with all this function right here string dot ASCII letters and that makes things very easy for us We don't have to go through that that char loop like we were doing earlier But I just want to show you guys that's how you could do it and now that we have an easier way We can get the lowercase letters and the uppercase letters and they're all in the built-in ASCII table We have nothing to worry about. So let's let's try that Let's try and rebuild this function all on our own though. Let's rebuild the is alpha number function So let's define something new. I'm gonna call mine is alphabetical Have to pass in the self keyword as always and then we need the string to look through and Now we don't have to be counting this time because we just want to get each character inside the string so for character in string to look through We're going to want to test if we have a conditional statement here if the character is in the ASCII letters Remember we have to use our string dot selector here because we're using something from this top module up here import string If the character is in there, then we don't have to worry about it. That's a good thing So what we should do is throw in a knot So if the character is not in that ASCII string letters and we're going to have to we're gonna have a problem here We're gonna return false because it's not but if we get if we break out of that for loop And once we're done processing if we haven't had any problems. We can just go ahead and return true So let's take a look at the at this ASCII string letters So so if we type in string and use our dot selector ASCII letters We have a string that's full of lowercase letters and the capital letters So it's going to return any letter or anything that's in the alphabet So if the character is not in that if it's a quote if it's a if it's a space if it's a quotation mark Give us an exclamation mark that sort of thing it's going to throw us a problem But if it is if it everything is okay, and we go through the string without any problems and just say yeah, that's fine This string is completely alphabetical. So let's try it now. Let's print out our string self dot is alphabetical This is the new function. We just created You can pass in self dot string we run this we get true and true because these are all all these characters in this string are part of the ASCII string letters So let's try it again This is a string and this will give us a problem obviously because we have these spaces in here But if we got rid of those It's it runs perfectly fine. So there you go guys that keeps it easy for you're able to test Whether or not there are alphabetical characters in here And we can do a lot more with this because the string module gives us access to so much more if we use our auto complete feature We can check it out We can even look at digits and that's what we're going to be using in the next tutorial We're going to be using this same idea and testing whether or not we find any digits inside the string so Let's see what else we can do with string though first of all I'm going to give you a little run-through through here You can check out all the cool things you can do and of course you can type in a help and then pass in that object And now you have all these interesting things You have some variables that you can check out including white space uppercase letters ASCII uppercase letters and that sort of thing but the difference between ASCII uppercase and ASCII lowercase and then lowercase and uppercase on here uppercase and lowercase these ones that aren't preceded by that ASCII name are Things that are local to your machine or your computer So if you happen to have changed settings where these where some other characters are considered to be alphabetical characters You may have a problem So for in this scenario you will want to test whether these are ASCII lowercase or ASCII uppercase because that is the standard so in our case we have Letters which is a combination of all of them and we have a well that's ASCII letters It's a combination of all of them and we have letters which is a combination of all of them But only the ones that you set on your computer that is local to your machine So you never know what a person might have changed on their machine So if you're doing processing like this, you might want to test for ASCII letters rather than the local version But but that's all. Thank you for watching guys. I hope you enjoyed this. I hope you're able to Go a little bit more in depth with these string functions check out the string module see what else you can do see what functions are Not recommended that you use some that are recommended that you use and that sort of thing But anyway, I will see you guys in the next tutorial. Bye