All language subtitles for 5. Our First Python Program

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

Hey you're still sticking your round.

That's good.

I didn't bore you with all my talking but yes in this video finally we're going to write some python

code.

Holy moly.

Thank God.

I thought that was going to last forever.

All right.

So what is our first program going to do.

Well let's create a very very simple function.

And probably the first thing any programmer learns to do to print our own name.

So in here once you have your rebel thought I.T. setup or remember you can also use got that Io we're

simply going to write.

Print and then you see over here that it gives us some information but all we want to do is write brackets

a quote so we can do double quotes here or a single quote and just type your name.

And if we click run on the right side we've just run our very first python program.

Very exciting but what's happening here.

Well let's let's look at everything.

First of all if you're confused why.

My thing is dark and yours might be light.

It's because if I go to settings I've set my theme too light or too dark.

I prefer the dark version.

But you can change some of your settings you can change the font size if you want based on when you

watch the video.

This Web site the look might be different but most of the settings should be the same we see that we

have a main dot pie which is the python extension any file that has a dot Pi or P Y is a python file.

So while we've just written here on line one is a program that prints.

In this case Andre now goy or in your case your own name.

And we've written it to this file now wrap all that i t takes this file already has this interpreter

for us it runs this piece of code gives this source code of main dot pi to the interpreter and runs

it right here on our right side.

If you look over here we're using python version three point six point one.

And down below we see that we have Andre Bagley printed.

That's awesome.

So this is our code running.

Remember this diagram all we've done is we have our main dot pi where we wrote print Andre Agassi we

gave it to the interpreter that the ripple already provides for us that interpreter takes our code converts

it into byte code in here he'll say Andre Agassi and then it runs it in the C Python VM which was on

the right side that we saw and it finally prints our name because it tells the machine hey we want that

text printed.

So that's what we're seeing here.

This is the C Python virtual machine essentially running this code and telling this machine Hey I want

you to print this.

All right but this isn't very exciting.

I mean let's let's make this program a little bit more dynamic for our first program we want to do something

more impressive than just print name.

So I'm going to teach you a another thing we can do in Python.

And it's called input now in here I can say input and you see that ripple it actually gives me some

information saying that oh I have this you can just click here and this input over here.

Well what can we do.

This input is going to prompt a user.

And if I hover over it you can see how it's giving me some information but input simply gives us a way

to capture information.

So let's say what is your name and if I run this code we see that we have our Python code running and

it's asking me what is my name with this cursor here.

So I can actually type something here.

I can say Andre and if I hit enter.

Well there you go.

I've just typed in my own name.

Nothing that exciting.

Right.

But this is where code becomes interesting because we can store this information on our computer.

So again these are things that we're going to go over in detail in our basics Python section.

But just to write our first code well let's assign this too memory that is let's say that name equals

whatever is the input of what is your name.

And then finally we can just print the name so remember the interpreter is going to take this first

line it's going to ask what is your name.

I'm going to type something that typed information is going to get assigned to name and then finally

we print name.

Remember an interpreter takes.

Line by line converts code to bite code.

And then finally runs it so let's give this a try.

I'm going to click Run.

All right.

What's your name.

My name is Andre do you see the I typed in my name.

Hit enter and then it printed out.

ANDRE So for the final feat let's greet.

So we're going to say print Hello.

And then plus name.

Now don't worry about the syntax.

We're gonna go over it but all we're doing is saying hello and then adding our name to the end of this

so let's see what happens if I run this and say What is your name.

My name is Andre and I hit enter I get Hello Andre.

But no spaces so let's add a little space hit run again for the fourth time My name's Andre and says

Hello Andre there it is our first python program now it's not very exciting because it is our first

program we're just learning the steps here but I hope because we've covered some of these topics ahead

of time that this isn't just pure magic right.

You understand that this is source code this is main dot PI that we give to an interpreter that runs

our code line by line and then executes our program.

In this case are what is your name.

Program.

How cool is that.

This is just the beginning.

We're gonna get more and more advanced here.

See if he can play around with this.

We don't know that much about Python yet but I hope this gets you excited because while there's a lot

more coding coming along I'll see in the next one.

Bye bye.

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