All language subtitles for 6. Print the Absolute Number - Solution

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

So what we want to do this exercise is to write a program that will receive some value, write value,

and these programs should print the absolute value of this given number.

So let's start then create our first variable and only variable for this exercise.

And it's going to be, let's say, no.

OK, so tandem.

Then we are going also to read the value from the from the user and enter integer, whether it's true,

whether it's positive or negative, positive or negative.

OK, so either it's positive or negative and then the user is going to insert this number.

We are going to use it to read it using this kind of function and store it inside now and now we are

ready to make our basically logic and the main part of this exercise thing that we want to do.

So we have num and num, maybe either positive or negative.

Right.

Just like we've seen in the examples before, and we want to print the absolute value.

So what do you have to do is to think about these two options?

OK, two scenarios.

The first scenario is either the number is negative or the number is positive.

And what differentiates between two of these scenarios, the question is very the answer is very simple.

It's just these conditions.

So if num if num is less than zero, Phnom is less than zero, then in this case we know that the number

is probably negative.

Right then in this case, what we should do is simply to print out, OK, the absolute value, the absolute

value of the percentage of num ease its use here.

Also percentage be then in this case, that's what we will have.

So instead of the first percentage placeholder, what we will use is simply.

And instead of the second percentage, since we know nothing is negative, for example, let's say minus

three, then in this case we should multiplied by minus one.

And if we do so, we know that minus multiplied by minus gives us final result of plus is correct.

So we simply take minus one and multiply it by now.

That's it.

So whatever value num had at this point or gave this condition is true.

It was definitely negative and if we multiplied by minus one then we turn it into some positive value

and we can represent it is the absolute value of num so awesome.

But if the result was false for this condition, then we know that the number itself is positive.

So that now what we can do is simply print this message.

The absolute absolute value of percentage is percentage.

And in both of these cases we will use none and none without multiplying it by any other number.

So very simple, just taking of a given number, checking if it's positive or negative and if it's negative,

multiplying it by minus one and if it's positive, multiplying it by nothing.

OK, so simply that's how it's going to work.

So let's build and run it and let's see what happens if we insert five.

So the absolute value of five is five and if we will use like minus 17, then the absolute value of

minus 17 is 17 since we multiplied it by minus one and that's it.

So yeah, I think that everything is clear in this video.

If you still have any questions, feel free to ask them in the questions sections.

And until next time, have a great day.

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