All language subtitles for 003 Comments_en

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) Download
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
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
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.

In this video, we'll go over comments in Python.

I am creating a new script.

Guido van Rossum, the creator of Python, once said that code is more often read than written.

When working with any programming language, you should include comments in the code to notate your

work.

This documents what certain parts of the code are for and lets other developers, you included, know

what you intended to do when you first wrote the code.

This is a very good practice in any programming language, and good developers make heavy use of comments.

Without them, things can get really confusing, especially in complex projects.

Comics in Python.

Start with the hash character and extend to the end of the line.

A comment may appear at the start of a line or following the code.

Comments are for clarifying code and are not interpreted by Python.

Let's see some examples.

This is a comment.

It's recommended to add a whitespace after the hash symbol for readability.

Hash A equals five.

This line is another comment.

X equals nine.

And I'm adding an inline comment here.

I create a variable called x.

That store's an integer.

A hash character within a string.

Literal is just the character, not a comment.

For example, my star equals a hash and I'm adding a hash character within a string.

Literal.

This is a string.

Literal is just a hash character.

It's not a comment.

In other programming languages, there are ways to comment out an entire block of code here in Python.

If you want to comment out multiple lines, you need to prefix each line.

You want to comment out with a hash sign.

I'm adding a few more lines of code.

In picture.

After selecting the code, you want to comment out press control and for backslash.

And it will comment out the entire block of code by commenting out each individual line of that block

of code.

And if you select that block of code again and press control and for backslash, it will uncomment it.

I am pressing control.

And for Slash.

Sometimes you might see something like this.

Triple quotes and some python code in between.

X equals ten.

Print x.

I'm running the script.

It didn't print the value of X.

Even though that's not interpreted by Python and is basically like a comment, it's not actually one,

but rather a docstring and recommendation is to not use this syntax for comments.

Doc strings are used for documentation and we'll talk about them later in the course.

The excel about comments in Python.

In the next video we'll talk about constants.

Thank you.

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