 Hey, what's going on guys? Root of the knoll here jumping back on the bandwagon with you guys for some python tutorials So let's get idle fired up and let's see what we can do here We have been recently working with some string functions and we've imported the string module And we've been able to do a lot of tests with boolean and that sort of thing boolean functions and Test whether or not the string is made up of uppercase or lowercase letters Maybe even some numbers and that sort of thing so today we're gonna be doing that once more But we're gonna be looking at it with space characters or white space So when we get our function all set here Let's jump back into the action. They can say self dot string and this will be a string character. This is a string We can add a little tab character in there Just for the sake of it and then this is a and then maybe a new line character because that those are nice So let's see what we can do here Normally you would be able to run the self dot string function or at least you would be able to use your your string variable here If you're running inside of a anything outside of object oriented programming You wouldn't need this self keyword beforehand, but because we are working in object oriented programming It's a good idea to have that you just need your variable name So in our case it's string and you use your dot selector and you can test you can test like is space and We can print this out We can run this and we get false because we do have this is a String this exclamation point all this other junk in here that doesn't mean anything but white space They're all they're all actual characters. So if we run this though now, we've got a space character We've got a tab queue. We've got some more space characters. We got a new line. We got some more space characters This should win perfectly fine. Yeah, exactly. It runs and it's true anything in this string is full of a space character So let's try it. Let's try and recreate this all in our own. Let's create a new function and then I'll define is space and Then the string to look through So now we can loop through it again for character in string to look through And now I want to introduce to you guys a new variable inside the string module if the character is in string Dada White space and white space is a new variable that we should be looking at White space is let's first of all its import string. I'll show you guys inside the interactive shell your import string We can have string and then if you dot white space It's a string full of a tab key a new line character some other things that like character line feeds and that sort of thing in Spaces and these are all things that don't have any actual like alphabetical or numerical value. It's just it's just white space It's just a blank like area or a blank character. So if we import string inside of our script here We can give this a go if character is not in the white space character though. That's when we have a problem That's we're gonna want to turn false Because remember when we return something inside of a function we break out of everything that we're doing we break out of this For loop and we break out of the function because we've already got an answer for the function We just say nope. It's not gonna work. We return false But when we're done looping through it all and if we haven't found a problem, we can just go ahead and say Yeah, that works fine. We can return true So let's try this in our own words now. Let's do Print so we can display self dot is space because remember this function is a local function that we've created ourselves inside this class Then we can go back up here and type in self dot string because we're gonna be testing for that string variable If we run this both of them are true because we still have the tab key in here We have a space and we have a new line character And we were comparing it against the real built-in function with this one that we just created ourselves with the with the string function here The string module. Sorry So if we added let's say a random a in there though, it's gonna have a problem because now you've got something that isn't white space It's gonna have a hissy fit. So but yeah, there you go guys. This is another simple idea It's just looping through the string and taking a look at some of the things that we've already predefined that are White space and then we can decide whether or not the string that we're looking for contains these characters or not But hey, there you go. Thank you guys for watching. Thank you for listening I know this is a real simple and easy tutorial just like some of the other few have been But hey if you stick with me, I'm sure it'll be more rewarding and you'll understand the fundamentals and the basics that I know You guys crave to understand because when you have those you can really just build your knowledge higher and higher And you can do more things with it, but anyway, thank you guys for watching though Thanks again and be nice if you could like the video maybe leave a comment Let me know what you think tell me what other subjects or some other ideas that you might want me to cover Some other functions I could explain or some modules that you might want me to go in depth with and that sort of thing And maybe subscribe I don't know if you want to see more things from me It's definitely a good idea and I will see you guys in the next video. Bye