All language subtitles for 3. Indentation In Python

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

I want to add a quick note about this spacing that we see in this code.

Now this isn't just for python.

In other languages you'll always see this.

You're not going to see that every single line of code always starts as well in the first space different

languages will use this differently.

But in order to organize code usually you'll see some indentation like this now.

Python however is unique because the indentation in spaces that we see here makes the interpreter see

it and say Hey this means something.

The interpreter would actually see the space and say because there's space here I know that this is

part of the if block in other languages like Javascript.

Well you have something similar but usually you'll have an if statement and then some condition followed

by make sure I spell condition right followed by something like a curly brace and in here whatever is

in here you can see that I still get the space and I can do whatever I want but javascript interpreter

doesn't really care that they're spaces if I want I could write my code just on the one line like this.

And it's still valid a javascript code so people usually do the spacing more for style purposes.

Python on the other hand is not just for styling that would do this but because the interpreter actually

finds meaning in the spaces which is actually one of the big selling point with Python.

It's very clean there's no extra stuff here that makes it difficult.

I mean it's just English right.

If it's old and if is licensed then print this is just really nice to read and really clean.

Now if you notice you're my editor and we're going to talk about editors and ideas in an upcoming section.

But if you're using the proper tools this automatically is created for you now in the programming world.

There's this debate about tabs and spaces and we're going to get into it.

It's frankly a little bit silly that is.

Some people prefer to hear if they want to create a space they might use spaces or they might use tabs

at the end of the day with Python.

The rule is we can use spaces you can use the tab but the idea that if you use spaces you usually use

for spaces is just a standard.

Now if you notice here I actually don't have four spaces it's two spaces here and that is because up

until now Well I've just been following along whatever this editor gives me.

But if you look over here there's an auto format button.

If I click on this it automatically formats my code into the appropriate format and you see right over

here that I now have four spaces.

But you see that the code still works.

Again it's because at the end of the day the important part is that there is a distinction between hierarchies.

That is the top.

And then maybe the children but the interpreter itself is going to notice these spaces.

So you do have to be careful because based on where this print is as soon as I add a tab in here and

I click Run what I get is old and is licensed.

But as soon as one of this is false and I click Run you see that.

OK.

OK.

He runs only if this condition fails again.

If previously both of these were true I only get the first line printed.

So that little space here changes the outcome of my program.

So you have to really be careful with this.

And luckily your editor or where you code is going to help you out with this but it is a gotcha that

if you're just starting out you want to be mindful of.

All right.

No more debates about spaces and tasks.

I'll see in the next video by.

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