All language subtitles for 011 Variables-subtitle-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
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-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

1

Hi, in this lecture you're going to learn

about variables. So what is a variable?

3

Well a variable is like a container

where you can store various data types

5

in Python for instance this program now

this doesn't have any variable in it for

7

now, so let me try and execute it and

you'll see that this prints out of the

9

hello string. String is a data type, but

we'll cover that later. Now what is the

11

variable? Well and variables will keep

your code more organized. Let me create a

13

variable here, greeting so you can call

your variables whatever you like you can

15

give them any name however there are

some naming rules which I'll mention in

17

just a bit, so let me create this

variable for now. I'll store in this

19

variable, I said variables are like

containers so I'll store this text in the

21

variable greeting and then what I do is

instead of doing print hello I'll do

23

print greeting and save the script ctrl

s and then go through the command line,

25

the upper arrow key, enter to execute and

you get the same output. So this is how

27

you create a variable you don't use any

quotes because when you use quotes you

29

are creating a string data type not a

variable and you can also use a dash

31

before the variable that would also be

fine so you get the output correctly

33

but you cannot use numbers before the

variable ctrl s to save, execute and get

35

an invalid syntax, so this syntax is not

valid in Python, but you can use numbers

37

after or between the variable name let's

say here greeting2. So that would

39

be fine to use so that's the condition

about naming

41

your variables, you can start them with a

letter or a, or an underscore. Now if

43

you're not experienced with programming

you may still be confused on why do we

45

use these variables? Well this is a very

simple program, actually very useless, but

47

normally your programs will interact

with your users. That is what we call a

49

real program. You create a program to

give it to people so they can interact

51

with the program they can generate all

different outputs and so on, so let's go

53

Ahead and make this program more dynamic, so

what I'll do here is I'll get the text

55

from the user interactively. To do that

you need to use the input function, this

57

is also a Python function and inside

the function you can enter a message to the

59

user so let's say write a greeting.

A column and make some space there and then

61

you print greeting2, save the script.

Execute and now the program is asking

63

us to enter some input so let's go ahead

and say hi this time and we get the output

65

Printed out in here, hi, so what

happened here is we created a variable

67

and that variable will store the value

that the user submits in the command line

69

here, in the terminal so the user

submitted the hi text and this text will be

71

stored in this variable so as I said

variables are like containers and then can

73

use this text in various ways, but in

this scenario I'm just passing it to the

75

print function, so I want to print it out

on the terminal here and the print

77

function will get the value that is

stored in the greeting2 variable and

79

print it out on the terminal. That's it.

And yeah, I'd like to close this lecture

81

now and I'll see you in the next lecture.

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