Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
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
Serbian
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
0 I have a list of five items here. 1
Let me show you why. Use the len function and you see that it has, it really has five items. 2
Now besides accessing single items out of your list like that item with index 3. 0, 1, 2, 3, so 6.6, 3
you can also access portions of the list. 4
Let's say from 1 to 4 and that will give you another list. 5
So the outputs of this is also a list and it's going to contain the items with index 1, index 2 and 6
index 3, the upper limit 7
it's not included, it's never included in a python slice. 8
So this is a slice. 9
And this is the output of the slice. 10
Let's try to get the first two items of the list. The first two items have an index of zero and one. 11
So we'll start with 0 since we also want the item with index 1 12
we are going to write 2 there, so that we get 1and that is the output. 13
So the index 2 is not included, 7.5 is not included. 14
You can also use a shortcut for that. 15
You don't have to type 0 16
if you meant to get everything starting from the first item and that will give you the same output. 17
Similarly, if you want to get let's say the last two items you can start to count 0, 1, 2, 3, so 3 start 18
from 3 and this has an index of 4. 19
So we are going to write 5 there. Even though we got the expected output. 20
You'd better be using the shortcut for that. 21
So this is more intuitive because it tells you that you're extracting from item with index 3 to the 22
last item of the list. 23
So without knowing how many items there are in the list. Similar here you extracting from the very first 24
item to the item with index 1, now for big lists 25
when you want to extract the last items, it may make not much sense to count from the beginning. 26
1, 2, 3, 4, 5, 6 and so on but Python has another system of indexing and I'll show you that in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.