All language subtitles for 002 Naming Conventions_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)
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 Download
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

In the last video, we talked about variables, what a variable is and how to declare a variable.

Now we'll go over naming conventions for variables.

Before starting, I'd like to talk a little bit about PEP, which stands for Python Enhancement Proposal,

and there are many of them.

A PIP is a document that describes new features proposed for Python and the documented aspects of Python

like design and style for the community.

For the moment, our focus is on PEP eight.

This is a document that provides guidelines and best practices on how to write Python code.

It was written in 2001 by Guido van Rossum, the author of Python and some other guys.

The primary focus of Pep eight is to improve the readability and consistency of Python code.

I recommend you to take a closer look at this document to see what its main points are.

This is really useful.

The recommendations I'll show you in this lecture.

Follow Pep eight.

In fact, I've tried to follow the guidelines provided by the document during the entire course, as

well as at my daily job when I code.

Let's move on and see some rules about naming variables.

Variable names can contain letters, digits and underscore.

For example, my underline name equals Andre age equals 40.

And they underline one equals, let's say today are all valid and recommended variable names.

A variable name can start with the number.

It can only start with an underscore or a letter.

For example, for you equals.

Thank you.

Is not a valid variable name.

This is an error.

This is not permitted in Python.

Pay attention if it starts with an underscore or double underscores, it has a special meaning to Python

and you should avoid it.

For example, underscore bonus equals 100 is a variable name but has special meaning to python and should

be avoided.

Don't use special characters in variable names like spaces, exclamation or question marks, parentheses

and so on.

For example, a exclamation mark equals eight is not permitted or a dot B equals 100.

They are not permitted.

Variable names can't be reserved words like true false non class if.

Else while.

And so on.

For example y equals ten is a syntax error while.

Is the language keyword.

It's recommended to use works written with lowercase letters separated by underscores.

Like for example, max underlined value equals 99.

By the way, this is known as Snake Case.

This is different from the camel case notation recommended in other programming languages, for example,

in Java.

The camel case notation means two group works by writing each word in the middle of the phrase with

no intervening spaces or punctuation.

For example, max permitted value equals 100.

This is camel case.

Using the camel case notation is not an error, but is not recommended.

Avoid using words that have special meanings or are already defined as data types like list, str,

set, tuple, and so on.

For example, SDR equals Python is not recommended.

There is no error.

But is not recommended.

Python is case sensitive.

It makes a distinction between lower and uppercase letters, and so are variable names.

A equals eight and the capital A equals ABC are two different variables.

Of course, you don't have to follow these conventions Exactly.

As long as you try to remain consistent within your own code.

So up next, you are going to have a quick quiz just to make sure that you have deeply understood everything

about the variables.

Good luck with the quiz and I'll see you in the next video where we'll talk about comments in Python.

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