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
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
Hi there, guys.
In this video, we are going to talk about relational operators.
Well, the name itself is kind of scary, but there is no need for panic just yet.
Relational operators are used in conditions and they simply tell you how you are going to ask a certain
question.
For example, how you are going to ask if a grade is higher than 80.
In our programming language and actually we've seen a couple of examples in the previous videos where
we use these relational operators probably without even noticing that.
And to tell you the truth, guys, you as a future programmer, you must be familiar with all of these
terms that we've used so far and all of the terms that we are going to use in these course.
And that's why in this video, we are going to talk about it in more detail and use a little bit of
more formality.
So we talked about different rules that should be followed in every programming language.
You do remember that, right?
So the same goes here.
There are things and rules that should be applied when constructing conditions.
Now you sing.
I sing most of the programming languages when you would like to ask a question.
It won't be simply enough to ask for it in English.
Something like if grade is greater than 80.
So we are interested in constructing the conditions in our programming language, just like we've seen
in previous examples.
And that's exactly the place and the time when we would like to use relational operators that will help
us with this task.
So relational operators are just these signs, which you've probably seen most of them somewhere before,
maybe even on your math classes.
And the first one, the greater them, helps in constructing a condition to check if the left side is
greater than the right side.
Then we have the greater than or equals two, which is pretty much the same.
It simply checks if the left side is greater than the right side or if the left side equals to the right
side.
So if either of these options happens to be true, then the result of the condition will be true.
So in most cases, if we would like to ask a question like if grade is greater than 80, we are probably
going to do it in this way.
We are going to use of the greater than relational operator assign and simply put, the grade, which
is a variable on its left and the value of eighty on its right.
And if this condition happens to be true, meaning that grade is actually is greater than 80, we are
going to execute some of their following commands that we would like to execute.
And the same goes for the less then and the less then or equals to science.
They are pretty much the same as we use the greater than the last.
Then checks of the value on its left is less than the value on its right.
And if that's the case, the result of the condition is going to be true.
We also may have times when we would like to check if the user has done a great job on his last exam.
So probably we are going to check if the grade was, for example, let's say a hundred.
So for that, we are going to use the equals to sign.
Please note that there are two of these signs right here.
And one, they are used this way when they come in despair.
They check the equality between what is on its left side to what is on its right side.
Otherwise, if you wouldn't have used just one of them, then you know that it won't be used to check
any condition, but rather it would simply be an assignment operation like we've seen Prieur in the
previous videos and in the previous section.
So that's an important note, guys.
Please make sure you do not mess around with this.
And here is an example of how to use the equals to logical operator check.
So you use if grade.
Then use the equals to sign.
And you use 80 or a hundred to just check that.
You did grade on your last exam.
And lastly, we also have the not equals to sign this operator as simply means that if we have it as
part of our condition and the value on its left does not equals to the value on its right, then the
result of the condition is going to be true.
The same as equals to just the opposite.
And if you would like to write a condition to make sure that you didn't run out of cash.
Meaning that we don't have a zero to our account.
You should use the.
That equals sign just like this.
And let's hope that these conditions shall always remain true.
Definitely not less then.
Don't let it be less than zero.
That's a problem.
All right.
So this is it for this video.
Now we know water relational operator, seeing how they can be used and now we are ready to move on
to our challenges.
So I'll see you there, guys.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.