All language subtitles for 13. Control Flow - Moving Forward!

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

What is going on, guys?

I hope you're doing well, getting a hold of all the new concepts.

We are learning in this chorus and in this video we are going to move even a step further with the control

flow topic.

So let's, first of all, review what we've done so far.

We used the basic live condition and based on its result, which was true or false.

We've executed some associated commands depending on the result of the condition.

You do remember that, right?

And we've seen a couple of examples, like when we wanted to find out what is the maximum value and

wanted to give a number is number one.

And number two, we asked if no one was greater than number two.

And if that's the case, if the result of this condition is true, we would have printed that the maximum

is number one.

Otherwise, we would have printed on.

Right.

Otherwise, if the result of the condition was false, we would have printed the maximum is number two.

So we basically will run different commands, different parts of code based on the result of a given

condition.

And also, we've seen an example where we tested out if a number forgiven number was even or odd.

We've seen how to test it.

We simply checked with the remainder of the division by two will be either a one or a zero.

And then based on the result we printed out.

If the number is even poorer.

The number was odd.

All right.

So I hope you got the whole idea of this, because it's very important that you didn't miss anything

that we said previously.

It was just a reminder for you guys.

Before we move on.

Right.

We moving forward in these control flow topic.

So now what I want us to do is to take a look at the following example.

So let's take a look at this exercise and it goes like this.

First of all, get a grade from the user.

All right.

Once again, get the users grade.

And if the grade is 80 or higher, we will print.

Excellent job message.

Otherwise, if the grade is not 80 or higher, meaning it's less than 80.

But yet it may be 60 or higher.

We will print not bad, but study a little bit more next time.

Message or write any of the grade is less than 60.

Meaning the two previous conditions didn't was not.

We're not satisfied.

We will print the following message.

Oh, you didn't pass something like that.

Try again next time.

All right.

Do your best for the next exam.

So if you take a closer look at this exercise and you can see basically that a simple if el statement,

just as we used previously, he's just not going to be enough in this case.

We've used here some more or let's say modified approach.

The LC approach, which is also sometimes called a nested condition.

And the reason for that is because we nest.

One condition into the other.

And let's see basically how it looks like the first condition was if Grady's 80 or higher.

And then the else of this result, meaning the grade maybe probably is less than 80.

But we still use the else if statement and we checked out if the grade, maybe it's less than 80.

But it still may be 60 or higher.

All right.

And if that's also not the case, then we are moving to the third through the force option in this case.

When we have the grade less than 60.

So just to make it clear.

Let's go over the flow once again, step by step.

All right.

So we got our great input.

That's the first step.

Get the grade from the user.

Now we use the condition to see if the test was good and if the grade is 80 or higher.

All right.

If grade is 80 or higher.

This is our condition.

This case is the result of this particular condition is true.

Then let's simply print some congratulations message and print to the user.

Some excellent job.

You've done great on your last exam.

All right.

But if the resolved.

This is not true.

Which leaves us with the fact that the result is false.

And now, at this point, as opposed to two different examples we've seen so far, we would like to

use another condition, a nested condition.

So we use the following condition to ask if grade is 60 or higher, maybe maybe 60 or higher.

Right.

It makes sense.

And we want to know if that's the case.

So we know that at this point, the grade is definitely less than 80, but now it can be in the range

between 60 to 80 or less than 60.

That's exactly what we want to find out.

And we want two different messages to different messages I'm sorry, printed for these two options.

So if the result of this condition is true, then we know that the grade is between 60 to 80.

And although that's not the best grade year that you can get on your exam.

That's not so bad.

Right.

So in this case, we would like to print not bad message.

And you've done you've done pretty well.

Not bad.

And otherwise, if the result of this condition happens also to be false, then we can definitely say

that the grade is less than 80.

And also it's less than 60.

So we will have to print a failed try again message and ask the user to give to give that another shot,

to give another shot at the exam.

So hopefully he will pass next time.

And that would basically be it, guys.

And that's how you use nested conditions in programming.

And you can embed them at any stage you like as many times as you like.

Just make sure that these whole structure makes sense.

All right.

And now, once we've mapped every sentence to these representation on the left, this graphical representation

on the left.

I want us to take a deeper look and see how it can be done in our programming language.

So let's take a look.

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