All language subtitles for 016 Lists-subtitle-en

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
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
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

1

Great, now let's look at lists, so in the

previous lecture we were looking at

3

strings and indexing and splitting

strings and I will be working with lists

5

which are very similar to strings. They

are similar because they are both

7

referred to as sequences, so there are

sequences of items. The difference is

9

that, let me open Python, and so the

difference is that the string is made of

11

other strings so it can contain only

strings of characters or strings.

13

whatever you like to call it, however

lists can contain various other data

15

types, let's say H a letter, a number, and

also a string. So this is a string the

17

first one, this is a number, an integer.

This is also string with multiple

19

characters and that is a list, so for

this you want to use square brackets to

21

create a list. Execute and yeah you can

call it and so this is a list of three

23

items and you can also store other

objects in a list but we'll cover other

25

objects in later sections, you know we

have table of objects with lots of data.

27

You may store files in a list you may

store widgets of a graphical user

29

interface that you are building and so

on, so these are very useful and lists also

31

have indexing and you can split lists,

you can extract items and so on. So the

33

good news is that lists have the

same indexing system as strings and so

35

you've learned that in the previous

lecture and you can go ahead and apply

37

that system not, so let's extract number 2.

That would have an index of one.

39

Execute that and yeah you get 2 there. If you

check the type you'll see that's an integer.

41

So every item of a list has its own

data type, even also access more than

43

white one item of a list. Let's say

you want the first two items. You do 0 1 2, so

45

like that or 0 to 2 whatever you like.

That will produce another list so the

47

type of this split is a list. The type of

the split of a string is a string, so S

49

for the string here, C for the list.

Lists now have methods associated with

51

them just like strings do and so you can

check what methods you have available

53

there by just doing a dir list.

So this a the blueprint you can use

55

lists, you can pass empty square brackets

in there, it's the same thing and then

57

you can use help to look at each of

these methods, so these are the methods.

59

Without the underscore and let's look at

the append method, so to apply methode

61

you do c the dot notation append and here

on that 3. What that does, it adds

63

another item to the end of the list,

So it appends an item to the

65

list and you can explore the other

methods if you like so let's say help.

67

Remove like that and you'll see how to

use that remove method, so you do

69

c.remove and then you pass the value of

the item that you want to remove, so

71

not the index but the value. Let's say we

want to remove 2 and you see that 2

73

is now gone from the list so look

at the other methods of the list and try

75

to experiment with this and play around

with them access items and split them

77

and you'll be good to go then.

Thanks, I'll talk to you later.

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