All language subtitles for 11. More on Conditionals

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 Download
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
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 0 1 00:00:01,860 --> 00:00:08,080 Now this conditional block happens to be a inside a function, but it can also be outside a function 1 2 00:00:08,830 --> 00:00:10,200 such as this. 2 3 00:00:10,210 --> 00:00:12,660 And let's say 3 4 00:00:12,670 --> 00:00:19,520 3 > 1 print greater. 4 5 00:00:20,140 --> 00:00:24,570 Else print 5 6 00:00:25,310 --> 00:00:30,380 not greater and you'll get greater. 6 7 00:00:30,380 --> 00:00:34,970 What a conditional block checks is actually checks 7 8 00:00:34,970 --> 00:00:42,290 if this is true, so True it's actually another type in Python just like integers, and lists, and strings 8 9 00:00:42,790 --> 00:00:54,280 true is another type, so that is actually the equivalent of if true print greater. 9 10 00:00:54,770 --> 00:00:59,910 Else print not greater. 10 11 00:01:03,260 --> 00:01:06,110 So true is always true. 11 12 00:01:06,120 --> 00:01:12,100 Similarly type 3 for example equals to int will return true. 12 13 00:01:12,150 --> 00:01:14,220 So that's what we are doing here as well. 13 14 00:01:14,670 --> 00:01:20,850 However there is another way which is considered better in Python to use 14 15 00:01:20,850 --> 00:01:29,670 isinstance, isinstance, value and you want to check for dictionaries here like that, executes and you're 15 16 00:01:29,670 --> 00:01:31,510 going to get the same output. 16 17 00:01:31,590 --> 00:01:38,230 So isinstance(3, int) will get you the same output. 17 18 00:01:38,340 --> 00:01:44,770 You can use either one but for some advanced reasons which I'm not going to explain right now because 18 19 00:01:44,770 --> 00:01:50,880 it's out of the context at this point of the course is better to use isinstance. 19 20 00:01:50,970 --> 00:02:00,300 You saw this example where I used if 3 is greater than 1 and I printed out great and not greater. 20 21 00:02:00,300 --> 00:02:06,490 So we could also have these three cases like three is greater than one. 21 22 00:02:06,510 --> 00:02:10,380 Three is equal to one and three is less than one. 22 23 00:02:10,410 --> 00:02:16,080 In that case if and else is not enough, we need something else, and I'm going to show you all we can do 23 24 00:02:16,080 --> 00:02:17,190 that in the next video. 2365

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