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