 What is going on ladies and gentlemen welcome back. I'm rid of the gnaw your host and today we're checking out some more Python tutorials I'm gonna open up idle and we can get to coding Create a new project here. Say this as file dot Python And we will quickly whip out our old Skeleton that we use for every video because we like classes We like object-oriented programming and you know what we like being able to not worry about Importing our modules and that sort of thing. So we have to have these preliminary code And I suppose I don't have to write it out each video, but you know why not It engraves it in my head, that's for sure Okay, and now we are set to go today I want to be talking to you guys about the sum function and that's sum and Usually when you have that built-in function you would just pass in an array. You could have a four five maybe one and then ten And it would return the sum of all the things that are inside that That list or that array or whatever you want to call it and This is a really easy function. I'm sure you can figure it out all by yourself But in case we'll go through a little walk-through and we'll see what we can do here First of all obviously we're gonna need to create a function We can get some we can get some Go on son get some I don't know what I'm saying. Don't listen to me and then here. We'll have the array. We'll pass that in And then for item in the array First of all, let's set an integer variable because we're gonna need to be working with something like that Some equals zero and then some can plus or equal to Some number Because if it's already a keyword, I don't want to bother with that some number plus equal item And we can print and now we don't want to print we want to return That's some I have an error defined. Oh, we do need to do something in this this little constructor here Let's just pass for now So now we can just do actually we don't even need to press we can just run the run the run the function print out self-dot self-dot get some I'm sorry. I shouldn't be giggling at that three four three ten 20 ten again Let's see what we got here get some takes exactly two arguments and seven of them were given Okay, yeah, this has to be an array and run that built-in function some Turn some number. I forgot the name of that variable. It's embarrassing now. We have 50 This works exactly the way we want it to we could add support for some strings if the type of the type of the item is A string we can just convert it item equals The integer form of the item can run that and everything's fine What if we had only some of them we know some of these were strings that should still be okay because It has that same sort of functionality to it. It's just looping through it and seeing if ones that are they'll fix it Not sort of thing So we should be all set. I wonder if the real some function has a support for strings It's worth a try ladies and gentlemen. Don't you think? You can pass an array to it. Let's do a 30 And then 10 and then 10 Let's see what happens. No, we get an error Unsupported operand types for int and string. Yep, it looks like they're trying to do that exact same thing We are just adding to each other with the operands So in our case, we just tried to fix that in case it does pop up for strings So that's all for this tutorial some finding the sum of a list that sort of thing is very easy I know it was a little fundamental but hey the more we know the better and The more we're able to piece these ideas together with for loops and logic and that sort of thing the the more prosperous We will be in the long run. So thank you guys for watching it'd be cool if you could like the video maybe leave me a comment tell me what you think and I'll see you guys in the next tutorial. Bye