text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
what I mean by immutable again I claim | 833.639 | 4 |
that immutable means that you cannot | 835.88 | 4.04 |
change the value well let's go ahead and | 837.639 | 4.44 |
try to do this let me go ahead and run | 839.92 | 4.44 |
this program once more as is python of | 842.079 | 6.241 |
student. let me go ahead and type in for | 844.36 | 7.399 |
instance uh how about uh padma's name | 848.32 | 4.439 |
and I'm going to go ahead and say that | 851.759 | 3.241 |
padma's in Gryffindor as in the movies | 852.759 | 4.601 |
and we see Padma from Gryffindor but | 855 | 4.32 |
technically I went down this rabbit hole | 857.36 | 4.2 |
and looking at Harry Potter more closely | 859.32 | 4.28 |
technically in the books Padma I believe | 861.56 | 4.16 |
was from Ravenclaw so this is actually a | 863.6 | 3.799 |
mistake or an inconsistency between the | 865.72 | 3.559 |
movies and the books let's see if we | 867.399 | 4.281 |
can't fix this inconsistency in our code | 869.279 | 4.881 |
so how about we do this if the student's | 871.68 | 4.8 |
name that's inputed equals Padma why | 874.16 | 5.08 |
don't we override whatever the uh | 876.48 | 4.279 |
whatever the house is and change it to | 879.24 | 4.599 |
be properly Gryffindor let me go ahead | 880.759 | 5.88 |
and do if student now if I want to get | 883.839 | 4.401 |
at padma's name I'm going to have to do | 886.639 | 3.88 |
student bracket zero I have to know what | 888.24 | 4.399 |
location the name is in in this tupple | 890.519 | 5.361 |
but if that in value equals equals Padma | 892.639 | 5 |
let's go ahead with this if statement | 895.88 | 3.519 |
and make a change let's change the | 897.639 | 4.801 |
students F uh bracket one value so the | 899.399 | 5.24 |
second value if we're zero indexing | 902.44 | 3.68 |
let's change it to be another house in | 904.639 | 3.401 |
the World of Harry Potter called | 906.12 | 4.88 |
Ravenclaw so I'm just fixing maybe the | 908.04 | 4.479 |
user's input they watch the movie so | 911 | 3.88 |
they type in Padma Gryffindor but in the | 912.519 | 4.961 |
books it was Padma from Ravenclaw all | 914.88 | 4.36 |
right let me go ahead and go down to my | 917.48 | 4.56 |
terminal window clear my uh terminal and | 919.24 | 5.08 |
do python of student. enter I'm going to | 922.04 | 4.599 |
do Harry as well as Gryffindor just to | 924.32 | 4.4 |
demonstrate that that is still working | 926.639 | 4.32 |
as intended Let Me Clear My screen again | 928.72 | 4.32 |
though and run python of studenty on | 930.959 | 4.641 |
Padma and I'll put her too in Gryffindor | 933.04 | 5.12 |
as in the movies and hit enter and now I | 935.6 | 4.84 |
just see a big mess of errors on the | 938.16 | 4.08 |
screen some kind of exception has been | 940.44 | 4.079 |
thrown and indeed a type error has | 942.24 | 4.279 |
happened I'm using a data type wherein | 944.519 | 4.361 |
there's an error and what is that error | 946.519 | 5.56 |
well tupple object does not support item | 948.88 | 6.199 |
assignment it's a little arcany Express | 952.079 | 4.801 |
that is that's not really very user | 955.079 | 3.361 |
friendly but if you think about what | 956.88 | 3.24 |
those words mean Tuple object does not | 958.44 | 3.68 |
support item assignment so assignment is | 960.12 | 4.12 |
copying from right to left so somehow | 962.12 | 3.8 |
that's invalid and here is a | 964.24 | 3.8 |
manifestation of the | 965.92 | 5.08 |
immutability of topples you cannot | 968.04 | 5.599 |
change location zero or one or anything | 971 | 4.639 |
inside that is a feature that is the | 973.639 | 5.041 |
design of a tupple so if I want to | 975.639 | 4.68 |
override that I think I'm going to have | 978.68 | 3.44 |
to use a different type of data that | 980.319 | 3.801 |
we've used before namely a list and | 982.12 | 4.04 |
that's fine if you want to enable | 984.12 | 4.159 |
yourself and colleagues using your code | 986.16 | 5 |
to change the contents of that container | 988.279 | 4.961 |
well we can go ahead and return not a | 991.16 | 4.799 |
tupple using explicit parentheses or no | 993.24 | 4.959 |
parentheses just the comma but I can use | 995.959 | 4.281 |
square brackets and if I'm using square | 998.199 | 3.961 |
brackets on the left and the right this | 1,000.24 | 5.32 |
is indeed explicitly a list same idea | 1,002.16 | 5.84 |
but it's mutable that is to say you can | 1,005.56 | 4.959 |
change the contents of a list so making | 1,008 | 5 |
no other changes just returning a list | 1,010.519 | 4.961 |
with square brackets instead of a tuple | 1,013 | 4.839 |
with parentheses or just the comma let | 1,015.48 | 3.919 |
me go ahead now and run python of | 1,017.839 | 5 |
studenty enter let me type in Harry and | 1,019.399 | 6.121 |
Gryffindor again that's still working | 1,022.839 | 5.2 |
good to see let me run this once more | 1,025.52 | 5.24 |
and type in Padma and Gryffindor as in | 1,028.039 | 5.241 |
the movies but no now we've corrected it | 1,030.76 | 5.159 |
to be Padma from Ravenclaw as in the | 1,033.28 | 3.799 |
books | 1,035.919 | 4.241 |
instead any questions now on tuples | 1,037.079 | 5.72 |
versus lists or this idea of | 1,040.16 | 4.879 |
immutability versus | 1,042.799 | 6.521 |
mutability uh can be used a nest cou in | 1,045.039 | 7.88 |
Python like a a nested list absolutely | 1,049.32 | 5.4 |
you can have not only nested lists in | 1,052.919 | 3.681 |
Python where one of the elements in a | 1,054.72 | 3.839 |
list could be another list so you have | 1,056.6 | 3.64 |
some square brackets out here you might | 1,058.559 | 3.401 |
have some other square brackets inside | 1,060.24 | 3.24 |
you can absolutely do the same with a | 1,061.96 | 3.839 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.