All language subtitles for 018 Dictionaries-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
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

Hey, hello! Let's look at dictionaries in

this lecture. This far we've looked at strings

3

we've looked at lists and tuples and now we

have yet another data type and these are

5

dictionaries. Let me open the python shell.

And let me create a list first I'm just

7

creating this for reference, so to

compare lists with dictionaries, but you

9

don't need to create a list for creating

a dictionary. So to create a dictionary

11

you need curly brackets, so open and

closing curly brackets and then inside

13

that you'd pass the items of the dictionary.

Now the difference here with

15

dictionaries is that instead of letting

Python add default indexes for your

17

items you want to create those indexes

yourself exclusively so therefore for

19

dictionaries you do something like this.

Name, a column and then the item. Let me

21

write another one, surname column and

then the other item and yeah that's it.

23

That's the dictionary. So what we have

here is when I was talking about

25

indexing I was referring to these things.

Actually these two are referred to as

27

keys, not indexes so for dictionaries you

can create custom indexes so to say and

29

so these are keys so we have key and

value, key and value. This is good because

31

now if you want to access one of the

values of the dictionary again you'd use

33

square brackets just as you did with

strings lists and tuples and then there you

35

pass the key which value you want to

extract, so if you want to extract John,

37

you want to pass the key of John and

that will extract the John value. Something

39

to note is that dictionaries are

an unordered colecton

41

of items and so sometimes you may

notice that the order of the key and

43

values is not maintained so you may see

that surname has gone to the first place, so

45

surname Smith and the pair has gone the

first one and name John is the second

47

one and so on. So this is different from

lists, strings and tuples. The reason why

49

Python doesn't keep the order is that

you know the way you access dictionaries

51

is you exclusively pass the key of the

dictionary when you access it and so you

53

don't need to know the order of the dictionary.

And whenever you want to access

55

something you say the surname for

instance and that will the return Smith

57

no matter where Smith is, so whether it

is the first one, the second one or over

59

and so on. And interestingly in

dictionaries you can also pass, you can

61

have like lists as values or even tuples,

so let me write a circle there or let me

63

keep it like that and let me add another

key and pair here. Let's say cities. Let's say

65

Joe Smith lives in three cities, Porto

and San Diego and Bali. You close

67

bracket there so as you see we have the

key here, we have a column and then you

69

have the value which can be anything so

it can be string, it can be a number, it

71

can be at list, a tuple. In this case

that's a tuple so if you access now

73

cities like that, you'd getโ€ฆ Sorry, I'll add

two bracket there, so you'd get the tuple.

75

And then you can also do tricks like you

know if you want to access Bali you'd

77

have other brackets there and pass 2.

And that would return Bali, so why is that?

79

That's because you know up to here you

have a tuple,

81

but that's a triple object and

then from that tuple you use again the

83

square brackets notation to access an

item from that tuple, so you want item

85

with index two and that is Bali and yeah

that's about dictionaries. Try them out

87

some more, play around and you will be able

to comfortably create and access items

89

from a dictionary. So I hope you enjoyed

this and talk to you later.

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