text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
back and improve your code but of course | 1,648.08 | 3.52 |
if you read the documentation you | 1,649.76 | 3.36 |
ingrain some of the lessons learned from | 1,651.6 | 3.52 |
the past you'll get into the habit of | 1,653.12 | 3.76 |
trying and checking for some of these | 1,655.12 | 3.76 |
exceptions yourself so let me solve this | 1,656.88 | 4.399 |
in one possible way as you proposed here | 1,658.88 | 4.24 |
let's try to handle this exception as | 1,661.279 | 3.76 |
follows let me go ahead now and instead | 1,663.12 | 4.159 |
of just blindly calling this print line | 1,665.039 | 3.441 |
let me try | 1,667.279 | 3.681 |
to print out hello my name is such and | 1,668.48 | 5.04 |
such except if there is an issue | 1,670.96 | 5.599 |
specifically an index error then what do | 1,673.52 | 4.8 |
i want to go ahead and do i'm going to | 1,676.559 | 4.561 |
say something like too few arguments i | 1,678.32 | 4.719 |
could be more explanatory than that but | 1,681.12 | 3.84 |
for now i'm just going to explain to the | 1,683.039 | 3.76 |
user that they gave me too few arguments | 1,684.96 | 4.56 |
too few words at the prompt so now it's | 1,686.799 | 4.88 |
still not going to work in quite the way | 1,689.52 | 3.759 |
i want i'm still not going to be able to | 1,691.679 | 3.12 |
generate their name tag but at least | 1,693.279 | 2.88 |
they're not going to see some cryptic | 1,694.799 | 2.961 |
error message and think that they | 1,696.159 | 3.841 |
themselves broke the program let me go | 1,697.76 | 4 |
ahead now and run python of name.pi | 1,700 | 4.24 |
enter and too few arguments okay let me | 1,701.76 | 4.639 |
go ahead now and do python of name.pi | 1,704.24 | 5.12 |
and type in my name david and now we're | 1,706.399 | 5.52 |
back in business and i see that my name | 1,709.36 | 4.24 |
is on the screen too | 1,711.919 | 4.081 |
but strictly speaking i don't have to | 1,713.6 | 4.48 |
try to do this i could actually be a | 1,716 | 4.399 |
little more defensive in writing this | 1,718.08 | 4.88 |
code and maybe i could check whether or | 1,720.399 | 5.361 |
not the user has indeed provided a name | 1,722.96 | 5.199 |
or multiple names at the prompt so as to | 1,725.76 | 4.72 |
give them more refined error messages as | 1,728.159 | 4.481 |
well so how might i do this well let me | 1,730.48 | 4.88 |
go and undo the exception handling i've | 1,732.64 | 4.639 |
added and why don't i instead more | 1,735.36 | 4.24 |
modestly try to do this let me go ahead | 1,737.279 | 5.201 |
and introduce a conditional here if the | 1,739.6 | 5.76 |
length of cis.rgv | 1,742.48 | 6.24 |
is less than two or equivalently equal | 1,745.36 | 5.6 |
to just one value but i'll just stick | 1,748.72 | 4.079 |
with less than two for now | 1,750.96 | 5.04 |
then go ahead and print out too few | 1,752.799 | 5.521 |
arguments so i want ultimately two | 1,756 | 4.399 |
arguments i want the name of the program | 1,758.32 | 4.16 |
at location zero and i want the name of | 1,760.399 | 4.081 |
the human at location one so that's a | 1,762.48 | 3.84 |
total of two arguments so if i have | 1,764.48 | 3.76 |
fewer than two arguments let's tell the | 1,766.32 | 4.16 |
user with this print line l if the | 1,768.24 | 4.48 |
length of sys.rgv | 1,770.48 | 4.4 |
is say greater than two like they typed | 1,772.72 | 3.679 |
in too many words at the prompt well | 1,774.88 | 4.24 |
let's tell them print quote unquote too | 1,776.399 | 5.76 |
many arguments else if they did get it | 1,779.12 | 4.799 |
right and they gave me exactly two | 1,782.159 | 4.481 |
arguments else let's go ahead and print | 1,783.919 | 4.48 |
what i actually care about all right let | 1,786.64 | 3.36 |
me go down to my terminal window here | 1,788.399 | 5.041 |
and run python of name.pi and voila | 1,790 | 5.279 |
a completely different type of error | 1,793.44 | 3.839 |
this one a syntax error which we've seen | 1,795.279 | 4.241 |
in the past now a syntax error recall is | 1,797.279 | 4.64 |
me a culpa like i messed up here and i | 1,799.52 | 5.12 |
wrote invalid syntax and so no amount of | 1,801.919 | 4.961 |
conditionals or exception handling is | 1,804.64 | 3.68 |
really going to catch this one i need to | 1,806.88 | 3.039 |
go back and just get my program to work | 1,808.32 | 3.28 |
because it's not running at all well let | 1,809.919 | 4 |
me go up here and see | 1,811.6 | 5.36 |
line 4 is the issue and indeed it looks | 1,813.919 | 5.76 |
like i have an unterminated string here | 1,816.96 | 4.56 |
i need to go ahead and now add this | 1,819.679 | 3.921 |
double quote so let me go ahead now when | 1,821.52 | 4.08 |
with that red herring gone let me rerun | 1,823.6 | 4.24 |
python of name dot pi and hit enter and | 1,825.6 | 4.64 |
now we see too few arguments okay maybe | 1,827.84 | 4.16 |
it wants my full name let me go ahead | 1,830.24 | 4 |
now and run python of name dot pi david | 1,832 | 5.44 |
malin typing in both words after the | 1,834.24 | 5.28 |
name of the file and hit enter and now | 1,837.44 | 4 |
of course it's too many arguments fine | 1,839.52 | 4.32 |
now i'll oblige and do python of name.pi | 1,841.44 | 4.56 |
and just david and there we have it my | 1,843.84 | 4.4 |
name tag printed on the screen so | 1,846 | 3.84 |
strictly speaking we don't have to | 1,848.24 | 3.439 |
handle exceptions if we can be a little | 1,849.84 | 3.68 |
smarter about it and just check for the | 1,851.679 | 3.36 |
things that we're worried about | 1,853.52 | 3.44 |
especially if we want to give the user | 1,855.039 | 3.52 |
more refined advice we don't want to | 1,856.96 | 3.52 |
just tell them no something went wrong | 1,858.559 | 3.761 |
or we don't want to pass we want to tell | 1,860.48 | 4.48 |
them no that's too few or no that's too | 1,862.32 | 4.56 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.