text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
you have a list of things that who knows
6,874.119
4.401
maybe will change over time places like
6,875.88
5
Harvard have constructed new houses over
6,878.52
3.719
the years so you might have to change
6,880.88
3.359
the list of available houses it didn't
6,882.239
4.041
happen in seven books or eight films of
6,884.239
3.721
Harry Potter but you could imagine maybe
6,886.28
3.919
Hogwarts eventually has a fifth house so
6,887.96
4.88
there's generally some value in putting
6,890.199
5.04
list of constants toward the top of your
6,892.84
4.12
file toward the top of the class so it's
6,895.239
4.44
just obvious what the list of values is
6,896.96
4.119
you don't want to necessarily tuck it
6,899.679
3.96
away in some function like sort
6,901.079
4
especially if you might want to use that
6,903.639
3.761
function in sorry especially if you want
6,905.079
4.721
to use that list in multiple functions
6,907.4
4
not just sort but if I kept adding to
6,909.8
3.08
this class you might want to use that
6,911.4
2.96
same list of houses in multiple
6,912.88
4.08
functions so let's keep it in the object
6,914.36
6.319
Itself by storing it in self. house is
6,916.96
5.199
all right well we're about to change the
6,920.679
3.321
course of history here perhaps let me do
6,922.159
4.361
python of haty and I think we're about
6,924
4.84
to assign Harry to one of those four
6,926.52
3.44
houses
6,928.84
5.16
randomly huh name error name random is
6,929.96
6.56
not defined well wait a minute where did
6,934
5.32
I go wrong here thinking back to our
6,936.52
5.599
class on libraries why did my code break
6,939.32
6.279
and not tell me where Harry is to be you
6,942.119
7.56
do not import the random Library exactly
6,945.599
5.721
the random library or module was
6,949.679
3.641
something I want to use I need to tell
6,951.32
4.24
python that at the top of my file so let
6,953.32
5.6
me go up here and do import uh random
6,955.56
4.96
and then below that let me go ahead and
6,958.92
3.44
clear my terminal window and try again
6,960.52
4.719
python of hatp crossing my fingers
6,962.36
5.799
seeing where Harry is going to end up
6,965.239
5.84
and okay Harry as of now is officially
6,968.159
4.92
in Hufflepuff despite everything you've
6,971.079
4.481
read or scene well let's run this again
6,973.079
4.241
let me clear my window and run python of
6,975.56
4.36
haty and now he's in Ravenclaw that's
6,977.32
4.6
consistent with using random let's clear
6,979.92
3.92
that and run it again he's still in
6,981.92
3.52
Ravenclaw but that could happen even
6,983.84
3.04
though there's four choices let's do it
6,985.44
3.759
again Hufflepuff back in Hufflepuff we
6,986.88
4.04
can't seem to get the right answer so to
6,989.199
4.44
speak now he's in Gryffindor albeit
6,990.92
4.84
randomly so we seem to have a program
6,993.639
3.681
that based on these limited tests seems
6,995.76
4.52
to indeed be assigning Harry to a house
6,997.32
5.2
randomly now I'm somewhat lazily just
7,000.28
5.08
letting sort print out this value I
7,002.52
4.679
could do something else like return a
7,005.36
5.359
string and then let me online 13 do the
7,007.199
6.161
printing for me but for now I think we
7,010.719
5.92
have an example of a class called hat
7,013.36
4.92
that nonetheless applies some of our
7,016.639
3.48
lessons learned thus far today where
7,018.28
3.72
I've created a class because a Sorting
7,020.119
4.401
Hat is frankly well a I was about to say
7,022
4.599
real world entity but really a fantasy
7,024.52
4.719
world entity and indeed that's a perhaps
7,026.599
5.321
common heuristic or mental model to have
7,029.239
5.44
when should you use a class to represent
7,031.92
5.04
something in your code very often when
7,034.679
4.44
you're trying to represent some real
7,036.96
5
world World entity or fantasy world
7,039.119
5.321
entity like a student which is something
7,041.96
5.32
in the real world like a Sorting Hat
7,044.44
4.44
which okay doesn't exist but hats
7,047.28
3.48
certainly do so quite reasonable to have
7,048.88
4.16
a class for hat and that's not always
7,050.76
4.24
the case that classes represent real
7,053.04
5.28
world entities but indeed we've seen
7,055
6.28
thus far that int and stir and list and
7,058.32
5.2
dict these are all structures that you
7,061.28
3.48
might have in the real world we have
7,063.52
3.24
integers and strings of text and other
7,064.76
3.72
things so it rather makes sense to
7,066.76
3.2
represent even those things more
7,068.48
4.239
technically using a class as well you
7,069.96
4.88
could use just a dictionary to represent
7,072.719
4.241
a student or a hat but again with
7,074.84
5.08
classes come all this and even more
7,076.96
5.759
functionality but I honestly am not
7,079.92
5.88
using classes in really the the right
7,082.719
6.281
way here why well in the World of Harry
7,085.8
4.879
Potter there really is only to my
7,089
4.76
knowledge one Sorting Hat and yet here I
7,090.679
5.361
have gone and implemented a class called
7,093.76
5.04
hat and again a class is like a
7,096.04
5.48
blueprint a template a mold that allows
7,098.8
5.16
you to create one or more objects
7,101.52
4.44
thereof now most of my programs thus far
7,103.96
3.4