All language subtitles for 021 More On While Loops__en

af Afrikaans
ak Akan
sq Albanian
am Amharic
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

Welcome back.

Before we go to the for Loop, I wanted to show you another application of the wire loop because it

will make it a little more clear what the difference is and when to use what.

So, for example, the for loop is really there to iterate through rangers' arrays and so forth.

And we will see what that means in the next video.

But before we do so, we will have to look at while loops which are great to execute a block of code

repeatedly as long as a condition is met, as we saw earlier.

So let's have an example where we don't look at numbers because so far we only looked at numbers.

We said, OK, var X, as long as X is, why, then do something.

But now let's say we have the situation where we have a variable called felt temperature and that one

will be cold.

So let's say we are in the room and it feels like it's cold.

So we don't know directly what temperature it is in terms of degrees.

Right, in terms of degrees Celsius.

So we have also a value called room temperature, which actually is that value.

So let's say 10 degrees.

And.

Now we will run a wild loop, which will increase the temperature, the room temperature, by one degree

until it's warm enough so that temperature is not cold anymore.

So here we are just going to say, as long as fildes temp is cold.

Please run this while loop, which will, as I said, increase the room temperature.

So now, of course, we still need a situation where this condition is not met any more, so we need

to create this situation so we can check if the room temperature is greater or equal 20.

Then set the felt temperature too comfy, so too comfortable, so it's not going to be cold anymore

and also print something onto the console, parental and.

It's comfy now.

So now if we execute this.

It will just print its coffee now.

Why is that what happened in this whole thing?

Well, we set the temperature too cold because when it's 10 degrees Celsius, then it's pretty cold

and we don't want to be in the room when it's that cold.

Wanted to be 20 degrees Celsius.

Which is 60 degrees Fahrenheit.

All right, so what you say is as long as it's cold, please turn up the heat.

So increase the room temperature by one.

And as soon as the room temperature hits 20 degrees.

Then said the Feld's temperature too comfy.

So now in the room, we feel like, all right is comfy.

It's a good temperature.

We can maybe even get rid of our jacket and then we can print.

It's comfy now.

And our while loop will stop, so at that point, our while loop will not increase the room temperature

anymore and it will jump out of this whole loop and execute whatever comes afterwards.

So this is just another application where you see that it doesn't have to be an integer that we're checking

here, it can be whatever condition that has to be met.

And as soon as this condition is not met anymore, the wire loop will stop executing its block here,

its body.

It's called Block.

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