All language subtitles for 22. Parameters and Arguments

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
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
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

Let's talk about arguments versus parameters which is one of our key terms that we use when describing

functions.

Let's see what they mean.

You see right now are say Hello Function is pretty generic.

Very simple right.

We're just while printing.

Hello.

It's kind of useful but not really the power of functions beyond just being able to call this multiple

times because it only lives in one location in memory is this ability for us to make it dynamic for

example in these brackets.

I can give it what we call parameters.

So in here we give it parameters

inside of the bracket.

So for example I can give it name which is a variable that I just made up I can call whatever I want

and I can leave it like that or I can keep giving it parameters as many as I want I can keep adding

a hundred if I wanted to so.

In this case let's just say this is an emerging so these are two variables or parameters that I've created

and this Say Hello Function is able to receive these two parameters.

What does that mean.

It means that we're able to use these variables inside of this function.

For example I can create this as an F string and say hello and add the name.

And then finally add the emoji.

And because I have these parameters I can use them as variables inside of this code block.

Now these parameters allow us to give the function when we call it what we call arguments.

And by the way the confusion between parameters and arguments people usually say one when they mean

the other.

It's a little tricky so hang in there.

Arguments are used as the actual values we provide to a function.

So now and say hello I can give it a name.

In my case let's just say hi to myself and then I can give it an emotion.

And you see how my editor is giving me the hint that I should give it an emoji because while I defined

it here again something that editors help us do.

So let's just give it just a smiley face with the tongue out.

Now these are arguments these are the actual value we provide to the function and the name of the variables

that we use that we receive are called parameters.

So parameters are used when we define the function and arguments are used when we call the function

defined and call and by the way some people also like saying call or invoking the function or invoke

the function.

So if you ever hear those words you know what they mean.

So if I run this I get Hello Andre with that smiley face and this is when functions get really powerful

because we're able to not just make generic functions that always do the same thing but we can create

a functions that do things based on what parameters we give it or what arguments we call it with so

that now I can use these say Hello Function to say hello to my friend Dan and also my friend Emily.

And if I click Run we've made our function more extensible we can use it in multiple places.

And if we're designing a game well we've just use this to greet our users.

And based on the user name I can use the same function over and over again we're keeping our code dry

and clean by doing something like this.

How cool is that.

All right let's take a break and I'll see you in the next video.

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