All language subtitles for 9. Conditional Explained Line by Line

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 Download
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 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

0 So what is going on in this script? 1

Let me explain this one line by line. 2

Python executes the function definition but it doesn't do anything because it's just a function definition. 3

Python does things when it finds a function call such as this one in here. 4

So here we are calling the function and the input value for that function will be a Monday temperature 5

which is equivalent to this list. 6

So this list will go and be stored in this variable. 7

So value is equal to this list. 8

OK. 9

So what happens is that the interpreter will check if the type of that list is dict. If that is true, 10

it will execute this line here. 11

So it will assign the 12

outputs of this expression to the mean variable. 13

However this is not true in this case because type of the list is not a dict. 14

So python will not execute this line. 15

It will go to the next line. 16

So if that was not true then it will do this thing here. 17

So the men will be equal to the sum of the list divided by the length of the list which is 9.26 18

something. 19

So this is the current value of the mean. 20

Therefore here the indentation ends. 21

So return is outside of the if and else block you can see here, it has to be outside. 22

So the conditional block ends here and the current value of the mean will be returned by the return 23

statement. 24

So you get that mean value for 25

that list. 26

If this was student grades instead what happens is that this dictionary will be stored in value and 27

if type of value is dict. 28

Yes it's a dict. 29

The men will be equal to that. 30

So to the mean of the dictionary. 31

And if this condition is true this is executed and python will ignore everything that is under else. 32

I said everything that is under else which means everything that is indented under else. 33

So the children of else 34

So to say, return of the mean is not a child of else, it's not indented under else. 35

It's independents. 36

It has its own indentation level. 37

So therefore the current value of the mean is this one in here, so return to the mean will actually 38

return the mean for the dictionary, that one in there.

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