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