text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
not have to equal subtraction and in
9,161.52
3.48
fact you and I have already seen another
9,163.319
3.881
context in which Plus plus means
9,165
5.359
something else plus has not always in
9,167.2
6.76
Python meant addition per se what else
9,170.359
6.801
has python used Plus for concatenation
9,173.96
5.2
for concatenation for joining two
9,177.16
4.64
strings for adding to a list can you use
9,179.16
5.199
plus as well so plus has actually been
9,181.8
5
funny enough overloaded by the authors
9,184.359
5
of python for us and so we can use the
9,186.8
4.559
same symbol in much the same way as
9,189.359
3.561
addition but with different data types
9,191.359
3.841
to solve slightly different problems
9,192.92
3.96
well let me propose that we go back over
9,195.2
3.84
to vs code here and let me go ahead and
9,196.88
5.2
create a new Final file called vault. py
9,199.04
5.84
so code of vault. and let me propose
9,202.08
5.279
that we implement the idea of a vault at
9,204.88
5.12
Gringotts keeping on theme wherein
9,207.359
4.321
there's a bank in the World of Harry
9,210
4.08
Potter and within this Bank uh families
9,211.68
4.639
and individuals have vaults containing
9,214.08
4.199
all sorts of money in The Wizarding
9,216.319
3.761
World and the type of money that exists
9,218.279
3.681
in the World of Harry Potter are coins
9,220.08
4.52
called gallions and sickles and canuts
9,221.96
4.439
and those are in descending order of
9,224.6
3.759
value and so inside of a vault might be
9,226.399
3.88
a whole bunch of coins gold silver and
9,228.359
3.641
bronze essentially each in those
9,230.279
4.321
denominations tucked away so how can I
9,232
4.76
go about implementing first of all the
9,234.6
4.56
idea of a vault so that I can store for
9,236.76
4.84
instance for Harry Potter how much uh
9,239.16
4.76
coinage is in his family's Vault or for
9,241.6
4.6
Juan resley the same well let me go
9,243.92
4.439
ahead and Vault up high and first create
9,246.2
4.279
a class called Vault essentially meant
9,248.359
4.361
to represent a bank vault perfect
9,250.479
4.321
another real world or fantasy world
9,252.72
4.12
entity that I want to represent with
9,254.8
4.559
code I could use a tupple or a list or a
9,256.84
3.92
dictionary but again I'm going to get a
9,259.359
3.721
lot more functionality with classes and
9,260.76
4.48
we'll see one final flourish with
9,263.08
4.56
operators inside of this Vault class
9,265.24
4.039
let's go ahead and do this let me Define
9,267.64
4.2
my init method taking its first argument
9,269.279
5.16
of self and let me Define uh three
9,271.84
4.639
arguments to this when you create a
9,274.439
4.681
vault in my code here I want to be able
9,276.479
4.201
to initialize it with some number of
9,279.12
3.319
gallions some number of sickles and some
9,280.68
3.44
number of canuts I want the US the
9,282.439
3.92
programmer to be able to pass in one or
9,284.12
3.84
more of those values ideally but they
9,286.359
2.881
can be optional so I'll give them
9,287.96
3.56
defaults so let's go ahead and Define a
9,289.24
4.239
parameter called gallion whose default
9,291.52
4.2
value will be zero sickles whose default
9,293.479
4.201
value will also be zero and canuts whose
9,295.72
4.52
default value will be zero as well so
9,297.68
5.16
the programmer can pass in one or two or
9,300.24
4.239
three or heck even none of those and
9,302.84
4.24
they'll all have some implied defaults
9,304.479
4.96
how do I want to remember those values
9,307.08
4.44
that are passed in well let me do this
9,309.439
5.96
self. gallion equals gallion and self.
9,311.52
7.4
sickles equals sickles and self. canuts
9,315.399
6.92
equals canuts and so I could add some
9,318.92
5.08
error checking especially if you don't
9,322.319
3.521
pass in a number I could turn these into
9,324
3.6
properties to do even more validation
9,325.84
3.24
but let's keep it simple and as always
9,327.6
3.56
Focus only on the new ideas so I'm just
9,329.08
3.6
going to trust that these values were
9,331.16
2.72
passed in and I'm going to immediately
9,332.68
4.04
assign them to these instance variables
9,333.88
4.96
what now do I want to do well let's come
9,336.72
5.32
up with a way of printing out what is in
9,338.84
5.519
someone's Vault ultimately but first
9,342.04
4.6
let's do this let's create a a vault for
9,344.359
5
The Potters by creating via assignment a
9,346.64
4.639
new Vault and let's say that the Potters
9,349.359
4.841
have 100 gallions 50 sickles and 24
9,351.279
4.761
canuts all right and that's in that
9,354.2
3.48
Vault and let's print out for instance
9,356.04
3.64
Potter all right let's run this code and
9,357.68
3.759
see how it works now let me go ahead and
9,359.68
5.88
run python a vault. enter okay seems to
9,361.439
6.601
work no syntax errors or anything else
9,365.56
5.56
but this is not very enlightening how do
9,368.04
6.04
I fix this thinking back to what we've
9,371.12
5.44
done before you have to use underscore
9,374.08
5.72
uncore s exactly I need to use one of
9,376.56
4.96
those special methods that comes with
9,379.8
4.519
classes and Define for myself how I want
9,381.52
5.08
a vault to be printed as a string so let
9,384.319
4.16
me go ahead and do that let me Define
9,386.6
4.52