text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
as file I'm going to go ahead and say | 2,411.099 | 6.181 |
this for line in file and then below | 2,413.619 | 4.98 |
this I'm going to do exactly as before | 2,417.28 | 3.66 |
name comma house equals the current line | 2,418.599 | 4.441 |
stripping off the white space at the end | 2,420.94 | 4.56 |
splitting it on a comma so that's exact | 2,423.04 | 5.94 |
same as before but this time before I go | 2,425.5 | 7.2 |
about uh printing the sentence I'm going | 2,428.98 | 5.58 |
to store it temporarily in a list so | 2,432.7 | 3.36 |
that I can accumulate all of these | 2,434.56 | 3.72 |
sentences and then sort them later so | 2,436.06 | 4.14 |
let me go ahead and do this students | 2,438.28 | 5.039 |
which is my list dot append let me | 2,440.2 | 4.98 |
append the actual sentence I want to | 2,443.319 | 3.54 |
show on the screen so another F string | 2,445.18 | 5.52 |
so name is in house just as before but | 2,446.859 | 5.46 |
notice I'm not printing that sentence | 2,450.7 | 4.44 |
I'm appending it to my list not a file | 2,452.319 | 5.881 |
but to my list why am I doing this well | 2,455.14 | 4.86 |
just because as before I want to do this | 2,458.2 | 5.82 |
for student in the sorted students I | 2,460 | 6.359 |
want to go ahead and print out students | 2,464.02 | 4.5 |
like this well let me go ahead and run | 2,466.359 | 5.581 |
python of students.pi and hit enter now | 2,468.52 | 5.88 |
and I think we'll see indeed Draco is | 2,471.94 | 4.02 |
now first Harry a second Hermione is | 2,474.4 | 4.86 |
third and Ron is fourth but this is | 2,475.96 | 6.659 |
arguably a little sloppy right it seems | 2,479.26 | 5.04 |
a little hackish that I'm constructing | 2,482.619 | 3.661 |
these sentences and even though I'm | 2,484.3 | 5.16 |
technically want to sort by name I'm | 2,486.28 | 4.74 |
technically sorting by these whole | 2,489.46 | 4.2 |
English sentences so it's not wrong it's | 2,491.02 | 5.04 |
achieving the intended result but it's | 2,493.66 | 4.14 |
not really well designed because I'm | 2,496.06 | 3.42 |
just kind of getting lucky that English | 2,497.8 | 3.059 |
is reading from left to right and | 2,499.48 | 2.639 |
therefore when I print this out it's | 2,500.859 | 3.661 |
sorting properly it would be better | 2,502.119 | 4.141 |
really to come up with a technique for | 2,504.52 | 4.92 |
sorting by the students names not by | 2,506.26 | 4.68 |
some English sentence that I've | 2,509.44 | 3.84 |
constructed here on line six | 2,510.94 | 4.62 |
so to achieve this I'm going to need to | 2,513.28 | 4.319 |
make my life more complicated for a | 2,515.56 | 4.74 |
moment and I'm going to need to collect | 2,517.599 | 5.76 |
information about each student before I | 2,520.3 | 4.86 |
bother assembling that sentence so let | 2,523.359 | 4.021 |
me propose that we do this let me go | 2,525.16 | 4.199 |
ahead and undo these last few lines of | 2,527.38 | 4.5 |
code so that we currently have two | 2,529.359 | 5.101 |
variables name and house Each of which | 2,531.88 | 3.84 |
has name in the student's house | 2,534.46 | 2.94 |
respectively and we still have our | 2,535.72 | 4.26 |
Global variable students but let me do | 2,537.4 | 4.38 |
this recall that python supports | 2,539.98 | 3.839 |
dictionaries and dictionaries are just | 2,541.78 | 4.2 |
collections of keys and values so you | 2,543.819 | 3.901 |
can associate something with something | 2,545.98 | 4.68 |
else like a name with Hermione like a | 2,547.72 | 5.399 |
house with Gryffindor that really is a | 2,550.66 | 4.38 |
dictionary so let me do this let me | 2,553.119 | 4.621 |
temporarily create a dictionary that | 2,555.04 | 5.16 |
stores this Association of name with | 2,557.74 | 4.8 |
house let me go ahead and do this let me | 2,560.2 | 4.8 |
say that the students here is going to | 2,562.54 | 4.02 |
be represented initially by an empty | 2,565 | 2.819 |
dictionary and just like you could | 2,566.56 | 2.34 |
create an empty list with square | 2,567.819 | 2.221 |
brackets you can create an empty | 2,568.9 | 3.719 |
dictionary with curly braces so give me | 2,570.04 | 4.26 |
an empty diction missionary that will | 2,572.619 | 4.861 |
soon have two keys name and house how do | 2,574.3 | 4.799 |
I do that well I could do it this way | 2,577.48 | 4.8 |
student Open Bracket name | 2,579.099 | 5.881 |
equals the student's name that we got | 2,582.28 | 5.24 |
from the line student bracket house | 2,584.98 | 5.22 |
equals the house that we got from the | 2,587.52 | 5.92 |
line and now I'm going to append to the | 2,590.2 | 6.6 |
students list plural that particular | 2,593.44 | 5.639 |
student now why have I done this I've | 2,596.8 | 4.08 |
admittedly made my code more complicated | 2,599.079 | 4.02 |
it's more lines of code but I've now | 2,600.88 | 4.439 |
collected all of the information I have | 2,603.099 | 4.801 |
about students while still keeping track | 2,605.319 | 5.161 |
what's a name what's a house the list | 2,607.9 | 4.8 |
meanwhile has all of the students names | 2,610.48 | 4.8 |
and houses together now why have I done | 2,612.7 | 4.56 |
this well let me for the moment just do | 2,615.28 | 4.38 |
something simple let me do for students | 2,617.26 | 4.62 |
in students and let me very Simply Now | 2,619.66 | 5.76 |
say print the following F string the | 2,621.88 | 6.38 |
current student with this name | 2,625.42 | 5.159 |
uh is in | 2,628.26 | 5.2 |
this current student's house | 2,630.579 | 5.76 |
and now notice one detail inside of this | 2,633.46 | 4.859 |
F string I'm using my curly braces as | 2,636.339 | 2.941 |
always | 2,638.319 | 3.121 |
I'm using inside of those curly braces | 2,639.28 | 4.74 |
the name of a variable as always but | 2,641.44 | 4.8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.