 Hey, what is going on guys root of the knoll here coming back at you with another python tutorial? I'm gonna start up idle and to create a new script here Save this as a file.python get my shebang line started I'm gonna create a new class call this one base Define a constructor pass in the self keyword Break out of our class and test in the global scope if the name of our script is equal to main Or in other words if this is the current script we are running or this isn't included We're going to create an object or an instance of our base class So now what we're gonna do here is move on Now recently we've been looking at a string variables and we've been trying to see the functions that we can call with these with this Data type we've been looking at converting the string to uppercase converting the string to lowercase We've been swapping the case around we've been testing whether or not it's all lowercase or all uppercase inside that string And that sort of thing but now we're gonna move on to list data types or like arrays We're gonna be looking at those from now on so I'm gonna go ahead and create one I'm gonna say self dot array. I'm gonna call my array because if I use list. Oh It's not gonna. It's not gonna highlight for me because it's not just plain old list But we can okay. I'm gonna call mine self dot list because I think that looks good and Inside our list we can have the values of this is a I'm gonna put in here list and now I'm gonna print this out So I'm gonna print out self dot list and usually we have been concatenating on some new line characters Now remember you can only concatenate with other string variable So I'm gonna convert this list to a string with our str function and we can display this So now we have this is a string when we want our program So let's take a look at what we're gonna be checking out today There is a function that you can call with your list data types that is called append And what this function will do is is a little operation We've been doing a lot recently and it's appending on to the end of the array So if we had a our array or our list here called this is a list or at least with the values This is a list what it will do is it will add on another value at the end here And that's what append is called. That's I mean that's the definition of a pen to add something on the end So if we try this what we can do is we can print self dot list and then we can append on and Then our value or at least a value that we pass to it will be added on the end of the list So we can use like right here We can have a question if we if we run this we're gonna get none And this is because our function here list dot append does not have a return title returns none by default In fact, that's just the way it happens because what it's doing here is it's actually modifying the original list self dot list, so if we don't we don't even have to print this out But if we go ahead and print out our list again self dot list You can see that it's been modified and has this right string at the end of it So it's actually modifying the real argument that we passed to it. So if we If we try and do this on our own, I'm we're gonna have it return to us the actual array So, uh, and you'll see what I mean. Let's get the function started. Anyway, I'm gonna call mine append I'm gonna pass in self array and Append this in our case append. This is what we're gonna be appending. So now we can set up array We can add on to it with our assignment operators plus equals and inside of our brackets here or these braces So we know that's a data type of it's oven of an array or of a list Sorry, I'm tripping all over my words here and we're gonna put inside the value of append this or what it is that we planned on appending and Then when we're done, we can just simply return array So now if we run this we can print self dot append and We can pass in self dot list and we can add on right just like we did before And now you can see this is a list with right here at the end If we run this after we had appended it with the original function though Remember now that's adding this now that originally adds this right up here We have a we have two rights because we've done it with our function and with the one up there So let's let's comment out the first one that a fault built in function And let's take a look at our our new our new list all by itself. We can do print out self dot list And now you can see it still has a right on there It's actually it actually has modified the original variable because we've taken what we've passed in here And we're actually adding on to it inside the array inside of the function anyway We can fix this though what we can do is we can set a New array and we can set that equal to the value of ray that we've been passed and we can modify new array New array plus equals append this and we can return that new array. So if we run this We still have that same output That's strange But you know, it looks like it's only doing this because we've set new array equal to the value of The original array so it looks like it's still working with what we've passed to it But what if we what if we sort of change this around of it? What if we returned array plus and then the value of append this? So we're adding them together, but we aren't modifying anything really So if we run this we get this is a list right and then we have this is a list So it's true. We aren't changing any of the variables. We're just sort of displaying both of them So you can really work around with this There are a lot of interesting code techniques and tactics that you can do here without having to have to modify the original variable And we're using this equal sign that assignment operator So this one could be a little bit more complex depending on how you look at it Especially understanding the way variables are passed to functions, but hey, I hope you guys understand the idea Or you can at least comprehend what we're doing here And yeah, I hope to be seeing you guys in the next tutorial. Adios