text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
glance | 1,425.919 | 3.401 |
rather complicated here let's look up at | 1,426.96 | 6.64 |
sys.rgv i'm going to bracket one here so | 1,429.32 | 8.2 |
clearly sys.rv bracket one | 1,433.6 | 7.92 |
is storing dav id but it's one in the | 1,437.52 | 6.08 |
past when we looked at loops recall that | 1,441.52 | 4.48 |
we said that they were zero indexed that | 1,443.6 | 4.48 |
is the first element is zero the next | 1,446 | 4.799 |
element is one this next element is two | 1,448.08 | 5.28 |
and so forth and yet here i am treating | 1,450.799 | 4.24 |
it as though my name is at the start of | 1,453.36 | 4.24 |
the list one well let me ask this | 1,455.039 | 3.681 |
question | 1,457.6 | 5.439 |
what is probably in cis.rgv of zero | 1,458.72 | 8.8 |
what is probably insist dot argv of zero | 1,463.039 | 7.12 |
the very first element actually in that | 1,467.52 | 5.759 |
list oh yeah i think | 1,470.159 | 5.361 |
it's like in c | 1,473.279 | 4.321 |
the name of program | 1,475.52 | 4.08 |
indeed it's indeed like in c in other | 1,477.6 | 4.319 |
languages the name of the program well | 1,479.6 | 4.72 |
if we consider what it was i typed i | 1,481.919 | 3.921 |
certainly typed python because that's | 1,484.32 | 3.12 |
the name of my interpreter and we don't | 1,485.84 | 3.12 |
really need to know that because we're | 1,487.44 | 3.76 |
using python itself but after that i did | 1,488.96 | 4.719 |
type two things i typed name dot pi as | 1,491.2 | 4.4 |
i've done so many times anytime i want | 1,493.679 | 3.681 |
python to interpret a program i've | 1,495.6 | 3.679 |
written and it turns out by convention | 1,497.36 | 5.04 |
what python does is it stores in sys.rgv | 1,499.279 | 5.361 |
the name of the file that you're | 1,502.4 | 5.12 |
executing or interpreting followed by | 1,504.64 | 5.2 |
any number of other words that you typed | 1,507.52 | 4.399 |
so all this time we could have been | 1,509.84 | 3.68 |
accessing the name of the program which | 1,511.919 | 3.36 |
frankly isn't all that interesting but | 1,513.52 | 4 |
we can also now access words that are | 1,515.279 | 5.041 |
typed after that prompt as well | 1,517.52 | 5.6 |
but of course if i don't type anything | 1,520.32 | 3.839 |
in | 1,523.12 | 2.799 |
what might happen here this might be | 1,524.159 | 3.201 |
naive of me to assume that there's | 1,525.919 | 3.12 |
always going to be something at location | 1,527.36 | 4.24 |
1 in sys.rgv let me go ahead and try | 1,529.039 | 5.52 |
this python name dot pi and no i'm not | 1,531.6 | 4.64 |
giving you my name because at this point | 1,534.559 | 3.681 |
i might not even know that you want my | 1,536.24 | 4.4 |
name to be typed so let me hit enter now | 1,538.24 | 4.72 |
and uh uh-oh we see now an error a | 1,540.64 | 4.56 |
so-called exception in python this one's | 1,542.96 | 5.04 |
a new one this one's an index error that | 1,545.2 | 5.92 |
elaborates list index out of range and | 1,548 | 4.4 |
turns out this is actually one of the | 1,551.12 | 3.36 |
most common mistakes in programming | 1,552.4 | 4.8 |
whether using a list in python or arrays | 1,554.48 | 4.88 |
or vectors in other languages is to try | 1,557.2 | 4.32 |
to access some element that does not | 1,559.36 | 4.319 |
exist you try to go too far to the left | 1,561.52 | 4.159 |
or you try to go too far to the right in | 1,563.679 | 3.201 |
this | 1,565.679 | 3.6 |
in this object that is just a list of | 1,566.88 | 4.96 |
some values so of course the mistake | 1,569.279 | 4.321 |
here is that i'm assuming there's going | 1,571.84 | 3.839 |
to be something at location one when | 1,573.6 | 4.4 |
really it's location zero that's the | 1,575.679 | 4.401 |
only one that has a value but fixing | 1,578 | 4.159 |
this is not going to amount to doing | 1,580.08 | 4.32 |
bracket zero because now if i go ahead | 1,582.159 | 4.4 |
and rerun this program with no other | 1,584.4 | 4.8 |
words after name.pi it says hello my | 1,586.559 | 4.961 |
name is name.pie which is fine if we're | 1,589.2 | 4 |
making a name tag for the program but | 1,591.52 | 3.68 |
that's not of course what my goal here | 1,593.2 | 4.64 |
is instead so if the fix is not just to | 1,595.2 | 4.8 |
change the one to a zero | 1,597.84 | 5.68 |
how else might i handle this error | 1,600 | 6.08 |
how else might i handle this error | 1,603.52 | 4.399 |
this index error that happens if the | 1,606.08 | 4 |
user just doesn't remember to or doesn't | 1,607.919 | 4.321 |
know to type their actual name at the | 1,610.08 | 3.44 |
prompt | 1,612.24 | 3.36 |
we could always put an exception into | 1,613.52 | 4 |
the program saying | 1,615.6 | 4.959 |
if there is um if there's nothing at | 1,617.52 | 4.72 |
location one | 1,620.559 | 4 |
we just come out to say okay we haven't | 1,622.24 | 4.4 |
got a parameter or something but if | 1,624.559 | 3.921 |
there is you continue along with the | 1,626.64 | 3.12 |
program | 1,628.48 | 3.28 |
perfect so if i might simplify we can | 1,629.76 | 4.24 |
try to execute this line of code except | 1,631.76 | 3.6 |
if there's an error we'll deal with it | 1,634 | 3.919 |
in some other way now ideally and once | 1,635.36 | 4.24 |
i'm a strong enough programmer i would | 1,637.919 | 3.601 |
have anticipated this and written the | 1,639.6 | 4 |
following code from the get-go but when | 1,641.52 | 3.039 |
you're learning it's certainly | 1,643.6 | 2.559 |
reasonable to see an error oh i didn't | 1,644.559 | 3.521 |
realize i should detect that and then go | 1,646.159 | 3.601 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.