Python Tutorial 19: Python Classes and Methods Homework Examples

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is paul mcquarter from toptechboy.com and we're here today with lesson number 19. in our incredible new tutorial series where you're going to learn python or you're going to die trying what i'm going to need you to do is pour yourself a nice strong cup of black coffee that is straight up black coffee no sugar no sweeteners none needed why because you guys watching this channel you're jet fighter aircraft and if you're a jet fighter aircraft this is your jet fuel go get you some all right so let's talk about what we're gonna learn today i'm gonna need you to go ahead and fire up your most excellent visual studio code and while you're firing that up as always i want to give a shout out to you guys who are helping me out over at patreon it is your encouragement and your support that keeps this great content coming you guys that are not helping out yet look down in the description there is a link over to my patreon account think about hopping on over there and hooking a brother up but enough of this shameless self-promotion let's jump in and let's talk about what we are going to learn today what we're going to do is we're going to look at the homework solution to the homework that i assigned you in lesson number 18. and so what i need to know right off the bat this is our time to be honest with each other were any of you able to do the homework on your own if you were leave a comment down below i am legend if you were not leave a comment that you folded up like a cheap walmart lawn chair okay you fold it up like a cheap lawn chair all right it's actually okay if you were not able to do it what i hope though is i hope you spend at least an hour trying to figure it out because as you just hit these impasses and can't figure it out and you're thinking and you're trying and you're thinking and trying you're actually learning and then when i show you you will really absorb it but if you're one of those people that just sit and watch me code looks real easy when i'm doing it you think you understand it as you're watching me but you can't do anything on your own so it's really important for you guys to be really trying your best to do these homework assignments but i digress let's go ahead over and i will bring up visual studio code i will also scoot out of your way and i do believe what the homework assignment was was to have a class that would keep track of students so we would sort of have a class of like student id i'm going to have a little sip and then what we needed to be able to do was for that student have a first name and have a last name okay and so you would create this object a student and then it would have a first name and it would have a last name and then you need some ability to go out and input the grades for that student using your class and then you so there would be like a method to input grades there would be a method to print the grades there would be a method to average the grades for that student there would be a method to find the high grade for that student and there would be a method to find the low grade for that student so i hope you guys were able to do it but let's just jump in over here and the first thing that we are going to need to do is over in our most excellent python files we are going to create a new program and i am going to call it student class dot p y the dot p y is kind of important and boom we've got ourselves a fresh new python program just waiting to be written so i'm going to start by creating my class and my class is going to be students okay my class is going to be students just like that okay now how do we always have to start we have to start by defining our init our init function and then we are going to pass it two parameters because i think when you create the object when you create the student object when you create the student you're just going to need to know first of all always you're going to need to know self and then you're going to need to know last or let's just put first and then last so that is what you're going to need and then what do we need to do well we need to set self dot first self.first is equal to first and then we need to set self dot last is equal to last and then that should be pretty good all right so let's just play around with this a little bit and so let's see if we can create a student let's say that i have let's say that i just have student one and that is going to be equal to students and then what are we going to pass it we are going to pass it i need to make that a string joe evans joe evans okay like that and then let's just see if we could print print students one dot first and then students one dot last does that make sense so we're just creating a student student one and then we're gonna print student one comma i guess i should probably i think that will work i think that'll work let's just try that and see what happens let's come up and run it and we are denied students one is not oh oh oh plural should be student singular okay did you guys see that that scared me i'm just firing up my first video today and i thought man have i forgotten how to do classes and so let's run this and uh okay can you guys see that i shouldn't have covered i shouldn't have covered up uh i will move this out of your way and then i'm going to do a control plus so that you can see down here better and now we're going to run this thing and it has joe evans okay so then i could come down here and i could create a new student i like to just create the students and then work with them separately so students student 2 is equal is equal to students and then let's say that we have shirley and then baker okay and then we'll come down here and we will print that i just like to show you that once you create student one it stays there you can go out and do all types of other stuff but student one is now an object and you can go back to it it's keeping track of the data and the functions associated with that student and so i could come here now and i could control v and i could say print student 2 and student 2 last again we don't have to put we don't have to put these because we're not calling a method we're just getting a variable from the init and since we're getting a variable from the init we just call it student1.first which was self.first up here all right let's give it a roll okay joe.evans shirley.baker boom how do you like that how do you like that okay that is just a good thing i like to just kind of get rolling here you know this is my first program of the day and yeah we know how to do classes all right so now probably one of the more interesting things that we are going to have to do is we're going to have to input grades for these people all right so i am going to need to create a new class and so i'm going to define and i'm going to call it g input for grade input and then that is going to need self as always and remember i'm going to inherit the name and so forth from this but then what am i going to need to know i'm going to need to know number of grades all right now notice that i don't put number of grades here when i create the student and so i'm not passing it that so this guy when i call g input i don't have to pass itself but from the main program when i call g input i need to pass it number of grades all right now i guess we should probably just keep track of that so i could say self dot ng self.ng is equal to ng so that you know i could then if i wanted to call uh you know student1.numberofgrades.ng and get that back and so that might be a good thing to have and that mr colon does not belong there okay that mr colon does not belong there all right boys and girls men and women here we go so what we're going to need to do is we're need gonna need to get those grades and so i need to get grades okay and that is going to be equal to like that i i bet that i could just go ahead and make that self.grades like that okay and then i'm creating an empty array to hold the grades in and then i'm going to go for i in range and where do i want to start i want to start at 0. okay and then uh in this case as i'm inputting the grades i can just use ng because it knows in this case what ng is i guess you could do self.ng if you wanted to because they're the same but let's just go in and then increment by one and it really bothers me when that thing pops up okay for iron range from zero to ng and so remember we're starting at zero so we need to stop one before ng but when you do range it actually does stop one before ng so we should be good to go and then who did we forget we forget our old friend mr colon don't forget your old friend mr colon now we need to say uh we need to input or we need to say just grd so we'll read it like that do i want to get fancy no i don't want to get fancy so we're going to say grd is going to be equal to what are we going to do we are going to input and i'm going to get out of your way i really hate help making myself tiny like that it's like i'm just fading out of your it's like i don't even exist anymore when i get that small but anyway we're going to say input and it's going to be a float so we're going to float the input and that darn thing is still let me go one smaller can you guys still see that i think you can still see that sometimes it doesn't get in the way when i do that okay so i am going to float the input and then i'm going to say please enter the grade colon and then this closes the string this closes the input and that closes the float and now i need to put grd in self.grades and so i can say self.grades and then what do i want to do i want a dot append and then what do i want to append grd okay so self drop grades would be like student one dot grades right and then what i'm going to do is i'm going to append to that that number i just got in which is grd all right so now what i need to do is i'm trying to think i don't think do i really need to return self.grades i don't think i need to return yeah i am just because i don't have to use it if i don't want to but i'm going to return self dot grades so then i could sort of read it into something and then print it out if i wanted to okay for so i'm going to return self.grades like that okay that might be kind of interesting and so let's come down here so we create the students we print their names out now let's just see if i can do an input so i'm going to say students and i better put it into something and so i could say great i could just say uh latest student uh yeah i just gotta put i'm just trying to see if i can get the data back out so i'm gonna say latest student is equal to student that is not i'm just going to say test grade and that just means i'm testing the function here we'll use this later but i just want to test it to see if it works so what i'm going to call i'm going to call student1 that's the object we created dot and then what did i call that up there we called it g input g input and then let's just tell it that we want it to input four grades and then after that let's just say print test grades like that okay so do you see what i'm trying to do i'm just trying to see if i can use this this method if i can use this method to get the grades associated with this student and i'm just going to ask for four grades so let's see if this thing's going to work kind of makes me happy kind of makes me happy that it didn't crash i'm going to make this bigger for you to watch and then i'm going to make myself bigger because i hate being a postage stamp okay so please enter the grade so i'm going to say 9 i'm going to click down here and i'm going to say 90 and then 95 and then i'm going to say 96 and then i'm going to say 97 and boom okay now i have those grades and those grades are associated with those grades are associated with that student also let's see here if i actually did okay now that i have done that now that i have done that i think that i could get it out just with self.grades yes i could uh yeah so let me see once you've run it once you have run it i think that i could just also say print i i think i could print this is bugging me okay i think that i could print simply because you can't do this unless you have called g input okay but once you have called g input it has input the grades and then it should know it should know what student1.grades are so i think i could just print student one dot grades like that let's try that okay so please enter the grades we are going to go 90 91 92 93 and oh okay that's four grades yeah it started with zero boom okay so what you can see is once you have called once you have called g input you can access the student grades as a variable now what's the difference between student1.grades i'm getting that variable self.grades that i set up here all right and i can just bring that out or i can get it with a return so you see the two different ways that i got that grade back one is i put it in test grades when i called the method okay the other way i could do it is let's just see this you see i could even just forget test grades all right and then i could take this out and so when i say student1 dot g input it's going to input the grades and then because it called it it's going to know what student1.grades are so i'm just showing you kind of two different ways of doing the same thing and so it comes down here and i'm going to go 90 click down here and i'm going to go 90 and then i'm going to go 91 i'm going to go 92 and i'm going to go 93 and boom you see i went out and i got those grades back just by doing student1.grades and that's probably a little easier to do it but you see how it didn't hurt anything to return it just in case you wanted to like read it back after you had done that and so that is really really good okay so now let's come down and let's say define p grades or let's say uh yeah p p let's go print grades like that and then for that if we're going to print the grades do we need to send it anything well no because for that student it already knows how many grades there were because we had to input them and i set self.ng to ng so it's going to keep track that if theresa had six grades and if tom had four grades it's going to keep track of that because i set that self.ng if i just left it as ng it would have forgotten it you know because whoever the new student was it would reset that but here it should know the number of grades and so i really don't need to pass it anything okay i really don't need to pass it anything so then i can come here and i can say for i in range and then i'm going to go from 0 to what self dot ng all right and the self is gonna come when i call this uh when i call this method and then i'm gonna go in one steps and then what am i gonna do is i'm going to print and here let's see if we can get fancy here let's say uh let's say print and then what i'm i'm going to print i'm going to say i'm going to print self dot first comma self dot last comma and then i'm gonna put the double the double right and then i'm gonna say so this would be like tom evans is tom evans's tom evans's grades are like that okay tom evans's grades are why did i use the double quote because that'll let me use a single quote as an apostrophe here all right and now what i'm going to do is i'm going to print grades of self.grades of i okay so that should just print out the grades and then just to keep the formatting good i'm going to drop out of the for loop and i'm just going to print a blank line like that and why do i do that so that way the next thing i print there'll be a little spacing in there so let's see what's going to happen so that should print the grades and so here what i am going to do is i am going to print let me get rid of that okay so we're just going to go student one student two we're going to come here and we've input the grades okay so now what we want to do is student one dot what do we call that thing print grades print grades and then we're calling a method so we need to put these but we don't have to pass it anything because it should already know everything that it wants okay so let's let's come down here let's get bigger okay i think you can see that and then i am going to run this thing all right please enter the grade please enter the grade and so this would be we're going to be 90 we're going to be 90 91 92 93 and then student one is not defined oh my goodness did you guys catch that student student one all right so that was an error okay so let's try this again please enter the grade we'll click down here the grade is 90 91 92 and then 93 and we are denied it says student one print grades take zero positional arguments but it was given one student one dot print grades define oh oh oh what did i do here what did i do here who did i forget here mr self okay always got to pass it the self and the self comes from the call you don't have to put anything in here the self comes from this okay so you don't have to put self in here when you call it it gets the self from there all right i think this is going to run this time that really scared me okay so this is going to be 90 91 92 93 and then boom there it is student one input works student one print grades works all right so now i'm going to take a swig of this go juice man we're on a roll here okay so now what do we want to do let's say student one dot student one dot uh i'm gonna define the function first so i'm going to define the method first so this was the print method let me this was the print method and so now i'm going to define and then i'm going to define av grades all right and then let's not forget who our friend mr self and then our friend mr colon all right now the good news is is that remember like on the printing i'd set self.ng to uh to ng so it should be remembering how many grades are associated with each student and so we need to average those grades so we we just need to set a bucket is equal to zero that's where we're going to add the grades into to average them and uh guys i don't need to do self dot bucket because i don't need to keep track of what the total is i just need to have a bucket and then i'm going to say for i in range and then we're going to go from 0 to i got to do n g dot self why because our self dot ng why do i have to do that because i want the number of grades associated with that student because theresa and tom might not have the same number of grades so i'm going to have self.ng and then i'm going to increment by one our friend who who's your friend mr colon and then what we are going to do here is we are going to say uh grd is equal to we're going to float it because a grade could be a 91.5 so we need a floating point number we're going to input and then we are what am i doing i'm doing input that made no sense excuse me that made no sense at all did it it was that sneeze was coming on and it just distracted me so what we need to do is we need to say bucket is equal to bucket plus right how do we average grades we add all the grades up and then we divide by the number of grades and so i've got to go one at a time and i've got to step through that list of grades and each time through take the bucket and add the new grade to it so bucket is equal to bucket plus self dot grades of i all right and do you guys now see how this self is is is so that when student one is called it's getting student one dot grades when student student two is called to get student two dot grades all right so this cell thing is really an amazing thing okay so now that is the bucket and then what i am going to say is avg is equal to after i've gone all the way through and added all the numbers up now i'm outside the for loop i'm going to say it's equal to bucket divided by ng right wrong not in g i need what self.ng and it should know what that is and then you know what i could do is i could kind of do two things i could say self.avg is equal to avg so then i could just go in and i could say something like uh you know student1.avg and then i would get their average back and i could do that or what i could also do with that is i could return avg and then i could just say something like avg is equal to student1.abg and then put the put the quotes on it and i think really that is a better way to do it yeah i'm not even going to mess with this i just like to call it and have it returned but i think i showed you how you can do it either way okay so now what have we done uh we've come in we've created two students and then we input the grades for student one and then we print the grades for student one and then what we could do is we could just say a v g is equal to student one dot ab grades student one dot student one dot av grades and then remember we got we're calling a method so we've got to put that on it and then what we could do here is we could we could print okay i'm trying to think here so this printed the grades and so let me take this out and so this is going to print the grades for me and then i am going to say uh print and then i'm going to say first and then i'm going to say comma and then [Music] has an average of and then comma avg so right i'm reading avg when i'd calculate the average grades and then i'm going to print out that student's grades does that make sense i hope so all right let's try that okay please center grade okay we are going to input a 90 a 91 a 92 and a 93 that looks good and then boom we got a oh okay first that should be student1.first right were you guys yelling at me hopefully that's what it was let's see okay we're going to input 90 91 92 and 93 and boom it says uh look at this please enter the grade 93 then joe evans's grades are 90 91 92 93 and then it says joe has an average of 91.5 boom do you see that look at that we are python class riding machines and you know why it's the go juice it's the jet fuel okay guys let's keep going here now the one thing is i'm just kind of real picky about formatting and you see how that put that space after joe evans and so what i want to do is student.first is a what student.first is a string and so i can just concatenate to that string this string and then it should work and so let's just give that a try real quick and so we say enter four grades and we're going to go 90 91 92 93 what happened oh i'm sorry let's run it again i don't need to enter the number of grades so all right let's go here so please enter the grade 90 91 92 93 and boom joe has an average of oh it was up here where the problem was well i can fix that you see it says joe has i can fix that by just putting a space there and then it's up here somewhere in the concatenate where i need to it was up in this print self.first self.last and then here what i can do is i can concatenate it with this string so self.last is a string concatenated with this string and now that should get rid of that space okay so let's try this down here we're gonna go uh we're gonna go nut uh let's come down here and we're gonna go 90 91 92 and 93 and boom do you see how now joe evans's grades are and then joe has an average of 91.5 boom all right guys we are really doing great here we have got a lot of this done don't we we have a lot of this done all right so we have uh we have uh input we have print grades we have average grades and now what we want to do is we want to find the high low grade okay so i'm going to define and i'm going to call it high low and then we got to pass itself so it knows who it is all right and our friend mr colon and then we're going to come down here and now we need to step through so we need to set up a high grade in low grade just to get the ball rolling so the high grade needs to be a very low grade so that you actually will find the high grade so the high grade needs to be initialized to zero the low grade needs to be initialized to a high grade which would be a hundred so that way you actually find the low grade and now what we are going to do is we're gonna for i in range we wanna step through what from zero to self.ng that's the number of grades self.ng steps in one we end this with who our friend mr colon and then we come down here and then what we are going to do is we are going to say if self.grades of i if self.grades of i is greater than high grade okay if the if the if the present grade if the present self.grade is greater than the high grade then what do we have we have a new winner so high grade becomes self dot grades of i alright now and that's all that we would have to do now what do we also have to do if self dot grades of i is less than low grade then what do we have we have a new loser so low grade is equal to self dot grades of i and i have a horrible mistake and this is i don't know why we get this mistake so much this should not be 1 this should be i like that okay and now what do we want to return right so now at this point we know what the low grade is we know what the high grade is i don't think we need to save that we're just going to pass it back because if you wanted it again you could come and just get it again so i'm not going to set self dot high grade and self.low grade to high grade and low grade i'm just going to return them so i'm going to return i'm going to return low low grade comma high grade like that all right so now let's come down here and let's add that so now what i'm going to do is i am going to come here and and i'm returning two values so what do i need to do i need to have two variables down here low g comma high g is equal to student dot student one dot and i always like uh look at that guessed it student1.hi low that's what i called it all right do i need to pass in any parameters no because it's going to get the cell from student one here okay and then i could say print student one dot first student one dot first and then i'll just do a plus concatenate and then had a high grade of and then comma and then it would be high g like that all right and then let's take that copy and paste and student one first had a low grade of low g all right so let's try this hey good news is it didn't crash and so please enter the first grade we're going to say 90. we're going to say 91 92 and 93 and high grade is not defined what is that nonsense oh i misspelled it hi you see that did you guys catch that and look he even tried to warn me hey here's something i haven't seen before i should have caught that like that why did that not go away that underline okay so let's see it shouldn't underlined it this time i think yeah all right you see when it underlines it it's kind of warning you that it hasn't seen it before all right so now let's try this we're going to run this program okay so student one is not defined what student one is not defined what do you mean student one is not defined line 35. oh look at this somehow i unindented that and all that nonsense you know when i tried to fix high grade i ended up unindenting that and it was putting that as part of the class which would be very bad okay let's go here please enter the grade not please enter the grade down here 90 91 92 93 and boom okay look at that all right let's look at this okay so please input the grade 90 91 92 93 joe evans his grades are 90 91 92 93 joe has an average of 91.5 joe had a high grade of 93 joe had a low grade of 90. and so we need a space between joe and had and so is this down here i'll put a space there and a space there and then that should fix that i don't need to run that again so that looks really good i like this a lot i like it a lot all right so let's think what else here the only thing i didn't like is it says uh please input the grades and it really doesn't uh it really doesn't uh when it's input it says please enter the first grade second grade third grade we really don't know who it's talking about so i wonder if we can get fancy up here and where we are inputting the grades you know instead of saying please input the grade i'm going to say please int please enter and then i'm going to add that to i'm going to put a space i'm going to add that to self dot first because it should know that it should have inherited that so please enter plus self dot first and then i'm going to add to that concatenate to it and i'm going to use the double quotes all right and then apostrophe s grade and then space all right let's try this okay whoa please enter joe didn't get the first grade okay do you see how it's trying to put the name there but i messed up that input somehow okay please enter and then it ends it and then plus self.first doesn't need that there and that needs to come out here so this closes the input and then i still need to close the uh float all right so i need you to look at this so plea please dot enter i mean please enter space that is a string i'm adding it to the string self dot first or i'm concatenating it i'm tacking it on to the end and then plus why did i use the double quote because i want the single quote to be the apostrophe i think this is going to work oh i could not convert string to float okay now that is interesting could not convert string to float and that is in line 35 again what is this ut4 grd it doesn't like what i did there it doesn't like how i did that so i'm trying to input i'm trying to give it so let's try this is just a good thing to do guys this is a good thing to do so let's just see if i can create the prompt so i'm just going to say p-r-o-m-p-t and that is going to be equal to this which is please enter space and then what am i going to do i'm going to concatenate that with self dot first which it should know and then i'm going to concatenate that with the string quotes apostrophe s grade okay now i am closing that string and then down here this whole thing now is just going to be the variable not the string but just the variable prompt and then i can look at this kind of simply and i can see grd is float of input of prompt and then prompt is there and ah you know what i did that was terrible here no this is input so this this is just uh this ng will work probably i'm just going to make that self.ng just to be a little bit more consistent all right so now let's try this and prompt up misspelled prompt p r o m p t prompt prompt all right so let's try this okay please enter joe's grade okay so it looks like it likes that but i need a space here like that all right so let's see if this will work okay so we come in here and then it says please enter joe's grade and so i want to say 90 91 92 93 and then boom look at that joe has an average of 91.5 joe had a high grade of 93 joe had a low grade of 90. all right cece i really like that now guys i don't know why it didn't work when i had it inside of here i probably made an error in there somewhere i probably had an error in the string but anyway we put it out here and it works okay i am just curious i know i shouldn't do these things live but what if i just copy this and then what if i just paste it there like that let's see if that will run okay yeah it works now so i must have had an error in the way that i entered it earlier and so it's going to go 90 91 92 93 all right and boom it all works and then we don't need this separate prompt nonsense that was just a tool and helping me to debug it all right guys i am having a lot of fun with this all right so now let's kind of go ahead and let's say that we do a couple of students all right so i am going to what what am i going to do down here student one is joe evans and then what i'm going to do is i am going to go ahead and when i create him i'm going to input his grades because that would kind of make sense and then when i create shirley i'm going to input her grades but she's going to have done a lot more work so she's going to have 6 grades and then that is going to be a student 2 that's going to be student 2. and then what we are going to do is we're just going to kind of do this all over here all right so then now i've got two students and i've got two reports so what i want to i've got two students i've got the grades in for those two students all right so let me uh sorry get out of your way hopefully you guys could see what i did right i'm just doing student i'm creating the two students here and i'm inputting their grades all right so now let's work with student one so we're going to say student one let's just say print print and then we are going to say grade report for and then it makes me scared to do this because of how much trouble i had earlier student one dot first and comma students do dot one dot last okay so i'm going to print grade report for student one dot first and student one dot last okay and now i am going to print and then i'm just going to print because i've already kind of given the student's name i'm going to just print grades and so how do i get grades that would be uh i'm that prints them up here yeah so there i just have to call print grade stats i just have to call the print grades right so i don't need to put a print statement down here to print the grades i just have to say student one dot print grades like that student one dot print grades and then the printing will be done up here okay then what i will want to do is i will want to print and i will just say uh average average is like that and then what should i do well it's going to return it's going to return the average right so it's ab grades and it's going to return the average so i should just be able to call ab grades here so have grades like that and then because it's calling the method i need to put that in so print average is ab grades and then i got to tell it who stud one and now i need to say i need to call that high grade so i will say low low grade comma hi grade is equal to and that's student one dot low dot high low i'm calling it and now i'm going to print low grade is and then comma low grade and then print high grade is and then comma hi outside the string comma high grade all right does that make sense let's see how many mistakes i made in there you guys are probably screaming at me for all the mistakes i've made already so let's see okay so please enter joe's grade it's 90 91 92 93 okay and then please enter shirley's grades all right that's pretty good let's make that bigger so you can see it please enter shirley's grades and she is a much better student than tom and so she is going to get a 97 98 99 and a 100 and then oh yeah and she had more grades right and so she's going to get another 99 and another 98. that scared me but remember we created shirley with more grades all right oh student one oh i misspelled student again man it's like the t isn't working on my keyboard the key isn't working on my keyboard okay so where was that student1 dot print grades and i think when i do print grades i'm calling something so i better do that all right so let's try this again and let's make it bigger for you all right so we are going to go 90 90 91 92 and 93 and then shirley's grade and her grade is going to be a 96 97 98 99 and a 100 and then another 99 and then boom okay look at this guys who's your huckleberry look at this we got this thing working now i'm your huckleberry right okay guys boom look at this okay so we input those grades and then after we input those grades there is no way to make that move smoothly okay maybe that will okay so joe ev so here's grade report for joe evans joe evans grades are 90 91 92 93 okay and then the average is 91.5 high low grade is 90 high grade is 93. okay now what did we not do we need to now go in and give the report on shirley because we did everything for joe but we didn't do it for surely so we're going to come up here and now we're going to take all this and then we're going to paste it and then this is going to be student 2. student 2 and then this is going to be student 2 and then this is going to be student 2 and then this is student 2 and then that should work all right so now let's make this great big here and let's make that where you can see it good and let's see okay let's run this thing all right please enter joe's great okay 90 91 92 93 that looks good right and then please enter shirley's grades uh 80s she had a bad day 86 99 100 97 and then 99 and then 98 all right and then boom look at this okay so grade report for joe evans joe evans's grades are 991 92 93 the average is 91.5 the low grade is 90. the high grade is 93. uh-huh grade report for shirley baker shirley baker's grades are 86 99 197 99 98 the average is 96.5 the low grade is 86 and the high grade is 100 aha boom we got it guys this has been a little bit of a long lesson but i kind of have taken you through these classes and methods now twice and i'm hoping you understand them because it's really first of all now when you look at other people's code you will understand these things that were maybe so confusing before that like what is this a init business it's just the it's the it's the method that is called when you create the student and it sets up those variables that you're passing in then you can set up all of these different methods you just pass itself you just gotta pass itself and then you can do all these separate things and then you can call those methods once you've created a student once you have created a student student's one then you can call all of those methods which is students1 student1 dot this method student1.that method okay guys i hope this made a lot of sense for you i've really enjoyed this and i kind of tell you where we're going we're what your homework for today is is that if you had not done this by yourself if you had to watch me do it and then you kind of did it along with me what your homework is is your homework is to now start with a blank sheet and don't look at my work and don't look at my video and do the assignment now from scratch without looking at it because if you can do it now from scratch without looking at it then you are where you need to be right okay this has been lesson number 19. i think i'm going to have one more lesson and that's a lesson on threading because threading is something that we're going to be needing to know how to do when we start working with the arduino because we might have one thing going on over here and we can't have that lock up our processing we might need something going on over here and something going on over here so we're going to have multiple threads running in our program and so that's what i'm going to teach you guys to do next week and then what i think i'm going to do is the next lesson the next python lesson will start a new playlist which is going to be doing 3d graphics and visuals and simulations where now you've just kind of gotten the foundation out of the way in this first playlist in the next playlist what i'm going to do is i'm going to show you how to do really really slick 3d graphics and 3d animations in python and this would be the thing that you could use to like maybe start writing some games or maybe you could use this to start doing some other some other really cool uh really cool things and so the next lesson is going to be another playlist and it's going to be kind of like v python visual python python animations and graphics lesson one but it really would be kind of like lesson 21 in this playlist if that makes sense okay if that makes sense okay guys i hope i hope you're having as much fun taking these lessons as i'm having making the lessons if you enjoyed the video be sure to give us a thumbs up be sure to subscribe to the channel hit that bell when you subscribe so you'll get notifications of my next lessons coming out and as always i appreciate if you will share this video on social media with other people because we need more people coding and fewer people watching silly cat videos paul mcquarter from toptechboy.com i'll talk to you guys later
Info
Channel: Paul McWhorter
Views: 5,853
Rating: undefined out of 5
Keywords:
Id: iExZsyAYK6o
Channel Id: undefined
Length: 57min 56sec (3476 seconds)
Published: Wed Jun 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.