text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
to just adding more and more attributes
4,244.04
3.44
to the class I'm going to pass in all
4,246.04
3.4
three of these values instead of just
4,247.48
3.48
two I'm not going to do anything
4,249.44
3.04
interesting with that value yet but just
4,250.96
3.36
to make sure I haven't made things worse
4,252.48
4.44
by breaking my code let me run python of
4,254.32
5.28
studenty I'll type in Harry I'll type in
4,256.92
4.68
Gryffindor and it turns out his Patronis
4,259.6
4.92
was a stag and hit enter I haven't seen
4,261.6
4.48
what his Patronis is in my output
4,264.52
3.8
because I didn't change my stir method
4,266.08
4.079
yet but at least I don't have any syntax
4,268.32
3.8
error so at least I've not made anything
4,270.159
5.241
worse but suppose now I want to have
4,272.12
5
functionality not just for initializing
4,275.4
4.72
a student and printing out a student if
4,277.12
5.599
my class is really meant to be a student
4,280.12
4.64
what I can do is not just remember
4,282.719
4.761
information about data about students
4,284.76
5.2
what's powerful about classes unlike
4,287.48
5.28
dictionaries alone is that classes can
4,289.96
5.68
have not just variables or instance
4,292.76
4.72
variables so to speak those attributes
4,295.64
4.16
we keep creating they can also have
4,297.48
5.759
functions built in AKA methods when a
4,299.8
5.28
function is inside of a class it's
4,303.239
3.721
called a method but it's still just a
4,305.08
4.119
function at this point we've seen two
4,306.96
5.12
functions already two methods called uh
4,309.199
4.401
double underscore init and double
4,312.08
3.92
underscore stir but those are special
4,313.6
4.639
methods and that they just work if you
4,316
4.08
define them python calls them
4,318.239
3.841
automatically for you but what if you
4,320.08
4
wanted to create more functionality for
4,322.08
4.28
a student so that your class really
4,324.08
4.36
represents this real world or maybe
4,326.36
4.68
fantasy world notion of a student where
4,328.44
4.759
students not only have names and houses
4,331.04
4.44
and patronises they also have
4,333.199
4.841
functionality they have actions they can
4,335.48
6.199
perform like casting a charm a spell
4,338.04
6.4
magically could we implement therefore a
4,341.679
5.761
function called charm that actually uh
4,344.44
5.92
uses uh their magical knowledge well
4,347.44
4.799
let's go ahead and Define our very own
4,350.36
3.76
function as follows Let Me Clear My
4,352.239
4.121
terminal window scroll back up to my
4,354.12
4.84
student class and instead of creating
4,356.36
4.68
yet another function that's special with
4,358.96
4.279
double underscores I'm going to invent
4,361.04
5.199
my own function or method inside of this
4,363.239
5.721
class I want to give uh Harry and
4,366.239
4.641
Hermione and and all of the other
4,368.96
4.56
students the ability to cast charms so
4,370.88
4
I'm going to define a function that I
4,373.52
3.56
can completely on my own called charm
4,374.88
3.2
though I could call this function
4,377.08
3
anything I want but because it's a
4,378.08
4.44
method inside of a class the convention
4,380.08
3.88
is that it's always going to take at
4,382.52
4.28
least one argument called self by
4,383.96
5.08
convention so that you have access to
4,386.8
4.8
the current object even if you don't
4,389.04
4.599
plan to use it per se all right let me
4,391.6
3.599
go ahead and propose that we Implement
4,393.639
4.121
charm in such a way that the method
4,395.199
5.44
returns an emoji that's appropriate for
4,397.76
5.68
each student's Patronis all right how to
4,400.639
4.56
implement this well inside of the charm
4,403.44
4.759
method let's go ahead and match on self.
4,405.199
5.201
Patronis which is the instance variable
4,408.199
4.04
containing a string that represents each
4,410.4
4.36
student's petronis and in the case that
4,412.239
5.241
it matches a stag for instance for Harry
4,414.76
4.36
let's go ahead and return maybe the
4,417.48
5.04
closest Emoji this horse here how about
4,419.12
6.2
in the case of an otter well in that
4,422.52
6.199
case let's go ahead and return oh maybe
4,425.32
5.08
the closest match to the otter which
4,428.719
4.641
might be this Emoji here and let's see
4,430.4
6
in the case of a for for Ron rather than
4,433.36
7.24
Hermione a Jack Russell Terrier let's go
4,436.4
6.88
ahead and return how about don't have as
4,440.6
4.84
many options here why don't we go ahead
4,443.28
4.48
and return the cutest available dog in
4,445.44
7.84
that case and in the case of no Patronis
4,447.76
7.36
recognized as might cover someone like
4,453.28
3.879
Draco let's go ahead and use a default
4,455.12
4.72
case using the underscore as in the past
4,457.159
4.721
and let's go ahead and return for this
4,459.84
3.52
oh what should happen if someone doesn't
4,461.88
3.6
have a petronis why don't we just see a
4,463.36
4.68
magical wand that seems to fizzle out as
4,465.48
4.759
in this case all right well now rather
4,468.04
3.52
than just print the student let's go
4,470.239
3.361
about printing their actual petronis so
4,471.56
3.92
I'm going to go down to my main function
4,473.6
3.8
here I'm going to still get a student
4,475.48
4.04