text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
things maybe instead you have an | 2,886.68 | 5.159 |
instance variable called self. names | 2,888.76 | 5.68 |
plural and you set it equal to a list of | 2,891.839 | 5.121 |
names or a list of houses now in this | 2,894.44 | 3.879 |
case I don't think that really solves a | 2,896.96 | 2.639 |
problem because I'm trying to implement | 2,898.319 | 4 |
a student singular so it doesn't really | 2,899.599 | 4.641 |
make sense to have multiple first names | 2,902.319 | 3.721 |
maybe a nickname maybe a last name so we | 2,904.24 | 3.56 |
could add those to but I don't think we | 2,906.04 | 3.68 |
need multiple names per se and in this | 2,907.8 | 4.319 |
case multiple houses but absolutely you | 2,909.72 | 3.96 |
could do that using some of our familiar | 2,912.119 | 4.121 |
building blocks like lists other | 2,913.68 | 4.8 |
questions how are classes or objects | 2,916.24 | 4.68 |
represented in memory how are classes | 2,918.48 | 4.52 |
and objects represented in memory so the | 2,920.92 | 4.72 |
class is technically just code it is the | 2,923 | 4.559 |
code on the top of my file lines one | 2,925.64 | 3.679 |
through four that defines that | 2,927.559 | 4.76 |
blueprints that template if you will um | 2,929.319 | 5.081 |
objects are stored in the computer's | 2,932.319 | 3.8 |
memory by taking up some number of byes | 2,934.4 | 3.08 |
so you're probably familiar with bytes | 2,936.119 | 3.96 |
or kilobytes or megabytes there's some | 2,937.48 | 4.68 |
chunk of bytes probably all in the same | 2,940.079 | 4.641 |
location in the computer's memory or Ram | 2,942.16 | 5 |
where those V where those objects are | 2,944.72 | 5.24 |
stored but that's what python the | 2,947.16 | 4.72 |
program handles for you python The | 2,949.96 | 3.68 |
Interpreter figures out where in the | 2,951.88 | 3.439 |
computer's memory to put it you and I | 2,953.64 | 3.24 |
the programmers get to think and solve | 2,955.319 | 3.48 |
problems at this level python The | 2,956.88 | 3.919 |
Interpreter handles those lower level | 2,958.799 | 3.961 |
details for you how about one final | 2,960.799 | 4.841 |
question on classes and objects no my | 2,962.76 | 5.44 |
question is if we can the same do the | 2,965.64 | 4.919 |
same thing with the dictionary so where | 2,968.2 | 4.8 |
to use classes good question if you can | 2,970.559 | 3.601 |
do the same things as you can with | 2,973 | 3.04 |
dictionaries why should you use classes | 2,974.16 | 3.12 |
because we are just scratching the | 2,976.04 | 3.039 |
surface now of what you can do with | 2,977.28 | 4.36 |
classes allow me to go back now to my | 2,979.079 | 4.24 |
keyboard and show you more of what you | 2,981.64 | 4.12 |
can do with classes but in short you can | 2,983.319 | 5.561 |
do much more with classes you can ensure | 2,985.76 | 5.24 |
the correctness of your data much more | 2,988.88 | 4.199 |
with classes you can error check things | 2,991 | 3.76 |
and generally you can design more | 2,993.079 | 3.641 |
complicated soft software more | 2,994.76 | 3.52 |
effectively and we'll continue to see | 2,996.72 | 3.76 |
today features of python and | 2,998.28 | 3.44 |
objectoriented programming more | 3,000.48 | 4.4 |
generally that allows us to do just that | 3,001.72 | 6.079 |
so let me propose in fact that first | 3,004.88 | 4.36 |
let's just tighten up this current | 3,007.799 | 3.76 |
implementation which again has us with | 3,009.24 | 4.559 |
an init method that just declares two | 3,011.559 | 4.52 |
instance variables self. name and self. | 3,013.799 | 3.8 |
house which again just creates those | 3,016.079 | 4.361 |
variables inside of the otherwise empty | 3,017.599 | 4.881 |
object and assigns them values name and | 3,020.44 | 3.96 |
house respectively let me go ahead and | 3,022.48 | 3.639 |
just do one little thing here I don't | 3,024.4 | 3.6 |
really need this student variable let me | 3,026.119 | 3.841 |
just tighten this up so that each time | 3,028 | 4 |
we improve or change the code we're | 3,029.96 | 4.08 |
focusing really on just the minimal | 3,032 | 4.4 |
changes alone so I've not fundamentally | 3,034.04 | 3.92 |
done anything different I just got rid | 3,036.4 | 2.8 |
of the variable name and I'm just | 3,037.96 | 3.92 |
returning the return value of this | 3,039.2 | 4.96 |
student function that's constructing my | 3,041.88 | 3.959 |
new object for me so I'm just tightening | 3,044.16 | 3.56 |
things up as we've done many times in | 3,045.839 | 4.76 |
the past well what if something goes | 3,047.72 | 5.8 |
wrong when in creating this student for | 3,050.599 | 4.681 |
instance what if the user does not give | 3,053.52 | 3.92 |
us a name and they just hit enter when | 3,055.28 | 4.079 |
prompted for name like I don't want to | 3,057.44 | 4.24 |
put in my computer's memory a sort of | 3,059.359 | 4.76 |
bogus student object that has no name | 3,061.68 | 4.2 |
right I'd ideally like to check for | 3,064.119 | 3.841 |
errors before I even create it so I | 3,065.88 | 3.88 |
don't create a nameless student it would | 3,067.96 | 3.92 |
just be weird and probably a bug to have | 3,069.76 | 5.039 |
an object that has no name similarly I | 3,071.88 | 4.199 |
don't want the user to be able to type | 3,074.799 | 3.961 |
in something random as their house at | 3,076.079 | 4.641 |
least in the World of Harry Potter | 3,078.76 | 3.799 |
there's really only four houses at | 3,080.72 | 3.52 |
Hogwarts at least or there's again | 3,082.559 | 4.081 |
Gryffindor and huffle and Ravenclaw and | 3,084.24 | 5.48 |
slitherin a list of four valid houses it | 3,086.64 | 5.76 |
would be nice if I somehow validated | 3,089.72 | 4.92 |
that the user's input is indeed in that | 3,092.4 | 5.159 |
list now I could do all of that | 3,094.64 | 5.439 |
validation in my get student function I | 3,097.559 | 5.081 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.