Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
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
I am one and welcome in this news with you in this video, we're going to talk about functions and more
precisely the basic function.
So a function is one of the most important thing in programmation and in Python function is like a variable.
You need to master it.
A function is very helpful when you have to do the same, could you have to apply a code?
But to me, multiple times, for example, if you want to compute the mean of a time series, but for.
1000 times there is you are not going to do a cookie past 1000.
Time to do exactly the same could, but with a little
modification.
So.
To fix this issue, you are going to use a function.
Let me show you a little example.
So to define a function you need to use to define oprah.com, then you put a space and you put the name
of your function, so may function and you open parenthesis, even if your function as no needed parameters.
And then you put the parameters of the input of the function, for example, in or example of compute,
the mean for many times there is the input will be the time series so param one person to person through.
Then you put double pane and you go to the name to the line and you need to have an indentation.
Then you can create for you function a dock, string a and doctrine is very important.
Why?
Because if you work with a very specific project and you create some function, you need to do a documentation
of your new function for you.
If you read the Quran again, but one year later, for example, and for other people which want to
see your code, for example.
So it's very important to tell what the function do, because if you have, for example, one hundred
function, it would be very impossible to understand all of the function without a documentation.
And then here we are good.
I'm not going to put a documentation because we create a very specific and easy function.
So this function?
Just
do the some of the three input.
And to use that function, it is very easy, so you just need to put the name of the function, the
parenthesis and the input that you want to give in the function.
And then in return, we have six because one two three is equal to six.
But sometimes it's very helpful to set default setting in our function.
So, for example, if I teach.
Dysfunction and for any reason, sometime I have just this parameter, and
if I want, I can set default parameter for the bond to end the Bond three.
It means that if.
I use this function, I can use it.
Putting the venue that I want for Bahrain to open three, but if I remove the venue of Pan £210 three
automatically, Biton put three for the bottom two and six for the prime three.
So if I run this, could we have one plus three?
So four plus six.
So 10.
So if I change this, we will have another result.
So it is important we need to understand the power of the function.
And for this video, I want to invite you to see it again and go under difficult for him to ask some
question about function.
If you are not comfortable with this notion.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.