 What's up guys root from no shell.com here today, and let's take a look at Python again I'm gonna fire up idle. You can do the same Create a new program here as always. We'll save this as a file.python as always. Let's get our shebang line as always If I can type it incorrectly Because I never can do that as never and then let's get our class How many times have we done this? How many times what is it now 43 something like that? I don't know Yeah, we're gonna need that constructor thing We're gonna pass in that that self keyword thing want to test for that thing With you know using that assignment operator thing these comparison operator that's what I'm that's what I'm thinking Root root is what we're using to assign. Okay And now let's just get a get some standard output in here. Hello world You like new line because I like new lines. They're curvy. There you go So now what we're gonna take a look at today is the absolute value function or ABS now? ABS would normally return the obviously the absolute value of an of any number so we can pass in like 10 and We should print that out We get 10 We get we passed in 30 we get 30 we pass in a negative five That that's all negative five you get five because what the absolute value of a number is it's really just it's a distance from zero So if you ever happen to have a negative number, it's always going to be a positive the positive form of that number So this is probably a really really easy function to write out. So let's do it. Let's just try it out here. Let's define absolute value And we can pass in self And then obviously we're gonna need another parameter for the number What if they had passed in a string though? We should probably we could test for some type if the integer actually if the type of Number is a string could very easily change this to Number is equal to the integer form of Yeah, number I lost my friend a thought there, okay, so now what we're gonna do is we're going to say if Negative If number is less than zero if it's negative the number is a negative number number it can Multiply or equal by negative one. So now number is going to be positive if it's less than negative I'm sorry if it's less than zero if it is negative we multiply by negative one and it becomes positive there dot So if it if it's not we can just play a little return the number because we don't really have to do too much work with it So let's try something like this. Let's we've got our function all set. It looks it anyway, and we can just do print Self dot absolute value I can pass in four Oh, I have an error Why is this? If numbers less than zero Okay, yeah, I guess I just had an extra space or something. Yeah All right, if the self if we're running the absolute value function we pass in any number to it Let's say we have 10 this time we get 10 if we pass in maybe a 20 we get 20 if we pass in negative 20 We get 20 if we pass in negative 500 654 whatever and save that we get negative. I'm sorry. We get positive 654. What if we pass in a string though? What if we did negative 654 as a string what if we did negative 10 we would get 10 What if we just did um? G It's gonna give us a problem because that just doesn't make sense So don't do that though I mean I see no reason why you would ever want to pass in a letter when you're trying to find the absolute value of something you being the programmer you can control when you call functions and why and Me should make sure if there are any integers inside that inside Inside your string before you like try and pass that to an absolute value function But the absolute value function is played a little simple if it's less than zero if it's a negative number Turn into a positive number and you should be set and we had it We added support for a little bit of strings here and there's not much to worry about so easy tutorial for you guys I hope you enjoyed this. It'd be cool if you could give me a comment. Maybe leave a like I think you should you should give me a like and maybe leave a comment And maybe subscribe. I don't know. It's whatever you'd like to do, but I will see you again in the next tutorial. Bye