All language subtitles for 26. Methods vs Functions

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

Hey long time no see it's it's been a while but I'm glad you're back and I'm I'm glad you're still hanging

in there.

Trust me thinks things are going to get a lot more fun once we actually start building applications.

But we do have to go through the basics so hang in there.

Now you may have heard me mention methods and functions before and I briefly touched on the subject

right.

We have functions like list print we have things like Max man what else do we have.

We have input.

These are all built in functions in Python.

Python just comes with this and we're able to use them.

And we also learned about functions that we can create ourselves custom functions like well some random

stuff and I just created a function that does absolutely nothing I can just pass through and these are

all functions because the way we call them is Well we say some random stuff and then we call it with

the brackets and give it some sort of data or leave it empty but we also learned about methods and methods

were different because the way we used them was using the dot notation we said Dot something.

For example if we had a string hello and I do dot I get a list of all these methods that the string

data type can use.

These aren't things that we can use like this because if I do capitalize

like this well it's going to give me an error.

It's going to say well I'm going to get an error with Max because it's expecting an argument here bullets

comet this out and click Run Again I get named capitalized is not defined because it's not a function

it's a method and then method has to be owned by something and who owns a method well whatever is to

the left of the dot in our case the string owns the method capitalized and that's what methods are they're

built in objects that have methods such as strings dictionaries sets topples all the things we've talked

about where as soon as we do dot we have access to all these methods they're owned by an object or a

data type.

And the fun thing is that there's a ways to build your own methods and I'll show you how to do that

later on and when we start talking about classes but he can see here that our editors help us determine

what type of methods that we can use.

And again these are built into python and you can also learn about these methods that we can use by

going to the Python documentation right.

Python 3 documentation is going to have a ton of things for us if we go to library reference for example

we can see here that we can learn about built in types.

So let's go to let's go to the set types.

And here you can see that we have set type.

And it shows us how we can use it.

Now Python doesn't have the easiest documentation to read for beginners unfortunately.

So sometimes it's better to actually just Google instead of going through the actual documentation but

you see here that the set type has clear has pop has remove if we want to use it we have update.

And these are the methods that we can use but at the end of the day both methods and functions allow

us to take actions right to take actions on our data types to have our programs do something.

And although they have these different names and one has a dot in front of it and another one while

we can just call it like this.

The difference is very minimal.

But keep that in mind when you hear people talking about methods and functions there is that difference.

And like I said before we will get two methods when we talk about classes to show you how we can create

our own.

I'll see in the next one.

Bob.

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