text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
I'm going to go to the top of my file | 1,738.88 | 3.799 |
and I'm just going to start a thought | 1,740.96 | 3.559 |
but not finish it yet I'm going to use | 1,742.679 | 4.921 |
this new keyword for classes called | 1,744.519 | 5.52 |
literally class so indeed the new | 1,747.6 | 4.199 |
keyword we're going to have here and if | 1,750.039 | 3.921 |
I go back to our slides here this would | 1,751.799 | 3.681 |
be the official URL where you can read | 1,753.96 | 3.319 |
up more on this particular feature of | 1,755.48 | 4.799 |
python in the official tutorial class is | 1,757.279 | 5.441 |
a new keyword we can use now this is | 1,760.279 | 4.321 |
coincidentally related to students | 1,762.72 | 3.439 |
because students take classes but it has | 1,764.6 | 3.16 |
nothing to do with the fact that dealing | 1,766.159 | 3.88 |
with students class is a general purpose | 1,767.76 | 4.56 |
term in a lot of languages python among | 1,770.039 | 4.281 |
them that allow you to Define these | 1,772.32 | 5.16 |
custom containers with custom names for | 1,774.32 | 5.28 |
pieces of data so let's go back to vs | 1,777.48 | 4.12 |
code let's use this new keyword and let | 1,779.6 | 4.24 |
me propose that we create a class called | 1,781.6 | 3.959 |
student and by convention I'm going to | 1,783.84 | 3.839 |
use a capital S here and I'm going to go | 1,785.559 | 5.441 |
ahead and with a colon get to later the | 1,787.679 | 4.921 |
implementation of this class so I'm just | 1,791 | 3.159 |
going to use dot dot dot which is a | 1,792.6 | 3.439 |
valid placeholder for now that just | 1,794.159 | 2.961 |
indicates to me that I'm going to come | 1,796.039 | 3.24 |
back back to implementing this later but | 1,797.12 | 5.559 |
as of now it does in fact exist I now | 1,799.279 | 6.601 |
have a student uh class defined for me | 1,802.679 | 6.081 |
that I can now use in my code here how | 1,805.88 | 5.44 |
am I going to use it well first of all | 1,808.76 | 5.039 |
let me go down to get student and let me | 1,811.32 | 4.599 |
change this code to no longer use a | 1,813.799 | 4.88 |
dictionary but to use this class I'm | 1,815.919 | 4.161 |
going to do this I'm going to give | 1,818.679 | 3.281 |
myself a variable called student as I've | 1,820.08 | 3.68 |
done before but I'm going to set it | 1,821.96 | 4.599 |
equal to Capital student open | 1,823.76 | 5.48 |
parenthesis close parenthesis so I'm | 1,826.559 | 4.921 |
going to do what appears to be calling a | 1,829.24 | 4.76 |
function and that function student with | 1,831.48 | 5.4 |
a capital S notice matches the name that | 1,834 | 5.519 |
I gave this class at the top of my file | 1,836.88 | 4.399 |
all right what do I next want to do I'm | 1,839.519 | 3 |
going to go ahead and give this student | 1,841.279 | 3.601 |
a name now if I were still using a | 1,842.519 | 5.201 |
dictionary I would say student quote | 1,844.88 | 5.76 |
unquote name using square brackets but | 1,847.72 | 5.319 |
this is not a dictionary it turns out | 1,850.64 | 4.279 |
classes have what for now we'll call | 1,853.039 | 3.841 |
attributes properties of sorts that | 1,854.919 | 4.24 |
allow you to specify values inside of | 1,856.88 | 4.08 |
them and the Syntax for that happens to | 1,859.159 | 4.081 |
be a DOT we've seen dots before we've | 1,860.96 | 4.12 |
used it in the context of modules and | 1,863.24 | 3.919 |
libraries more generally this is another | 1,865.08 | 3.959 |
similar in spirit use of a DOT that | 1,867.159 | 4.041 |
allows you to get at something inside of | 1,869.039 | 5.24 |
something else so student. name is going | 1,871.2 | 5.359 |
to be the syntax I use for giving this | 1,874.279 | 4.681 |
student a name and that name is going to | 1,876.559 | 5.321 |
be whatever the return value of name is | 1,878.96 | 4.36 |
and then I'm going to go ahead and say | 1,881.88 | 3.88 |
student.h house to give another | 1,883.32 | 4.76 |
attribute called house and give that the | 1,885.76 | 4.2 |
return value of input here prompting the | 1,888.08 | 3.839 |
user for house and then as before I'm | 1,889.96 | 4.599 |
just going to return student but now | 1,891.919 | 5.48 |
what's really powerful about class and | 1,894.559 | 4.401 |
object-oriented programming more | 1,897.399 | 3.88 |
generally is that I've created this | 1,898.96 | 4.36 |
custom data type called literally | 1,901.279 | 4.88 |
student capital S I've stored one such | 1,903.32 | 4.8 |
student in a variable like I can always | 1,906.159 | 3.721 |
do in a variable called student | 1,908.12 | 3.64 |
lowercase s but I could call it anything | 1,909.88 | 3.48 |
I want I just make sense to call it | 1,911.76 | 3.68 |
student as well but lowercase for | 1,913.36 | 4.199 |
clarity and then I'm returning that | 1,915.44 | 4.239 |
variable and because of my syntax in | 1,917.559 | 5.281 |
lines 14 and 15 that has the result of | 1,919.679 | 6.88 |
putting inside of that class a name | 1,922.84 | 6.719 |
attribute and a house attribute I just | 1,926.559 | 5.08 |
need to make one more change up here I'm | 1,929.559 | 3.801 |
going to go ahead and remove our Padma | 1,931.639 | 3.481 |
code just so we can focus only on what's | 1,933.36 | 4.279 |
new rather than fixing her house and I'm | 1,935.12 | 4.08 |
going to go in here and change the | 1,937.639 | 3.441 |
syntax that previously was for | 1,939.2 | 4.68 |
dictionaries again dictionaries use | 1,941.08 | 5.28 |
square brackets and then strings in | 1,943.88 | 4.399 |
quotes either single quotes or double | 1,946.36 | 4.039 |
quotes depending on the context here | 1,948.279 | 3.36 |
though I'm going to change this to be | 1,950.399 | 4.28 |
student. name and over here I'm going to | 1,951.639 | 6.121 |
change it to be student. housee and | 1,954.679 | 4.521 |
that's just going to be my new syntax | 1,957.76 | 3.159 |
for getting the contents of what appears | 1,959.2 | 4.52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.