Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.