All language subtitles for 13. How to Find Out What Code You Need

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
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 To calculate the average of these grades we want to see if a list type has some sort of mean or average 1

method that allows us to get the average of its values. 2

For that we go to check with dir list. 3

So list is the name that represents all lists. 4

So that is the type. 5

And this is an instance of that type, of the list type. Dir list and let's have a quick look here. 6

Do we have a mean or average method? 7

I don't think, so so there's no methods of the list type to allow us to calculate the average of a list 8

values. 9

However that doesn't mean that it doesn't exist 10

a mean method in Python to do that. Mean or average 11

it's not a method, but it can be a function. 12

You remember the print function so print like that. 13

You see that print doesn't need the dot notation to be used like for example the upper method did need 14

a dot notation because upper is a method attached to the HELLO type and print is a function, it is an 15

independent function that works with many types, not only strings, not only integers, float. 16

You can print anything with print. 17

That's why it's not attached to a specific type. 18

So where do we see a complete list of functions that we can use. 19

You can do that using dir again underscore underscore built ins underscore underscore close parentheses. 20

And that is 21

a complete list of what you can use built in functions and also types in Python because here you also 22

see like the list word that we used an str, and that's basically what Python has 23

in a nutshell so these functions, and the methods of the types such as str, and least and so on. 24

These are actually the built in features of Python. 25

What comes with the Python installation. 26

We will see later that there are also libraries made by other people for example to process images. 27

To process pixels of an image. 28

Python doesn't have that because that that'd be too much to be included in the Python 29

default installation so people have come up with libraries which are still Python codes and we'll look 30

at that later. 31

So this external Python code that you can install as an add on, as an extension will allow you to make 32

more operations, but the built in Python is this basically. 33

So let me see for a mean function, or an average function. 34

No, it's not there. 35

Okay but there is a some function. 36

So what we can do is, let's say my sum, don't use sum as a variable name because you can see that sum 37

is a reserved keyword. 38

So sum(student_grades), that will give us the sum of these three numbers, and then we want to count how many 39

items there are in that list. 40

So do we have a count something there? 41

Maybe not. 42

Well I know that there's no count method but we have this Len. 43

Which means... You can check what it means. 44

So return of the number of items in a container. 45

So a list is also referred to as a container. 46

Let's say a length equal to Len. 47

Student grades. 48

And then finally we can get the mean which is my sum divided by length and printout the mean, save and 49

that is the mean value of all those three numbers.

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