All language subtitles for 29. List Methods 2

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Welcome back.

Let's keep going with some more stirring methods.

Now we've learned about adding and removing once we learned about a penned insert an extent and then

a removing we learned about pop remove and clear there's a few other important ones.

Let's go with the index so instead of clearing here let's clean this up and we'll do basket dot index

and index as you can see we give it a value a start and a stop.

What does that mean.

Well we want to say hey what index is number two if we do index of two and I click run it's going to

give me one.

I know this is a little confusing but it's asking for the index Where is number two.

Number two is that index of 1.

Let's change these into letters just so it's more clear.

So we have a b c d.

And then finally e and again if I do D here and I click Run I get an index of 3 because 0 1 2 3.

It's on shelf 3 in our memory.

And you can also do a optional parameter here which is where shall we start looking.

So I want you to start looking at index of 0 and then finish looking at index of 2.

If I do run here I get an error.

It says hey D is not in List because while we started at index of 0 and stopped it index of 2 if I do

three and I click Run No it stops right before three.

So if I do four and I click Run there yo I get three now errors are not good or in our programs ideally

we don't want to get errors.

So how do we avoid this.

What if we're looking for something and we're not sure if it's in the list or not.

There's another nifty way of looking for things in that list and this involves what we call a python

key word a key word is something that you use in Python that well already has some meaning.

For example a keyword here if I go to Python keywords are all these wars that already mean something.

Now we're gonna go through them and we haven't seen a lot of them yet but you might have seen true right

in boolean values to mean something.

So in Python we can't really use the word true because well it already means something.

There is a word called in that as you can see as soon as we type means something as a keyword in Python.

And this is quite nice.

We can say hey is D in the basket and if I run this I get true okay is X in basket I get false because

well it doesn't exist and this is actually quite useful and we can even do it for strings for example

if I'm looking for let's say the letter I in a word and let's say it's I in.

Hi my name is Ian if I click Run I get true because the letter I does exist in this string.

All right well let's learn another one Another one is basket dot count and we can count how many times

an item occurs.

So for example if I do D and I click Run I get one because D only exists once in the list but if I add

another D in here and I click Run we get to it counts how many time this value occurs in our list very

very useful.

All right.

A few more still to go.

Let's do some exercises and I'll see you in the next one.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.