All language subtitles for 7. Operator Precedence

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

Welcome back let's talk about a important term when it comes to programming.

And that is operator precedents.

Now what does that mean.

Again we're using our knowledge from math class.

It's the idea that if I do 20 plus three times four it means that different operators have precedence

over different ones.

That is we multiply this first equals to twelve and then 20 gets added to twelve because the Python

interpreter is going to follow a basic set of rules.

For example if I do 20 minus three here and let's print this out click Run I get eight because three

times four gets evaluated first which equals to 12 and then subtracted from 20.

It's not that this goes first and then we multiply 17 by four and this operator precedents shouldn't

be new.

Right.

If you've taken any sort of math class you understand that this is how well math works and this works

the same in all programming languages.

So the order is this first.

We follow the brackets.

So whatever is wrapped in a bracket we do first.

The second is we do the power of.

So whatever is done in the power of will be after parentheses.

For example if I do parentheses here and then to the power of let's say two or less two plus two to

the power of two.

Well the first operation that will happen is 20 minus three because that's the first precedence.

And then we do two to the power of two because that's the next precedence and then only after we do

that we add these two together.

If I click Run I get twenty one which again makes sense.

Seventeen plus four after the power of we have the multiplication and division and then finally the

last precedence is addition and subtraction.

Now this isn't going to be a math class.

Some people really love math.

Some people really don't.

But I want to just give you this basic understanding of operator precedence.

When you see it.

We'll do some exercises here to get accustomed to it.

But trust me this is as mathy as we're gonna get in this course.

The math part of the course is well just here.

It's gonna get a lot more interesting as we learn about different data types.

I'll see in the next one.

Bye bye.

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