All language subtitles for 04_getting-started.en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
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 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 this course, you're going to learn to write computer

programs in the Python programming language.

But before we get into that, we need to know exactly what programming is.

Fundamentally, programming is giving a list of instructions for

a computer to follow.

In the contest of programming,

this instructions are sometimes called algorithms.

Now computers are really good in following this instructions very reliably and

very quickly but not very creatively.

And we can't just give computers instructions in English or any other

natural language that we normally speak because natural language has ambiguity.

Words or sentences can have multiple meanings which computers can't figure out.

Instead we need to give computers instructions in a programming language,

which is a kind of language that computers can understand

because they have a formal syntax or set of rules.

There are many programming languages that exist including JavaScript, C++ Java,

Haskell and many many more.

But in this course we're going to learn to use the Python programming language.

The process of learning programming is more than just learning the rules of

the Python programming language.

It's also about how to breakdown and

solve problems regardless of the programming language.

And I like to think of programming as a translation process, where the programmer

translates their goals from natural language into a programming language.

For example,

if I want to write my own version of the game Wheel of Fortune, then I need to

translate the rules of the game into an unambiguous set of instructions written in

the Python programming language that tell the computer how to run the game.

And as you become a programmer, you'll learn how to come up with strategies, or

algorithms, for solving problems in how to translate these strategies

in the Python code that a computer can execute.

Now, all that said, the best way to learn programming is through practice, so

let's get started.

In this course, you'll be able to write Python codes right in your browser.

You'll see what are called active code windows

that look like this in your textbook.

Now, most programming courses start off with what's called a Hello World program

or a program that prints out Hello World on the screen when you run it.

In Python, a program to print Hello World looks like this.

In order to actually run this code, we need to click the Save & Run button.

When we do that, we'll see an output window show up to the right here.

Now to break down what all of this shows,

we have our Python source code on the left.

And we have our output on the right.

Now, when we click Save & Run what happens is that there's a hidden Python

interpreter.

And it looks at what's in our source code, and

prints out whatever any relevant output is.

And remember that this source code is a set of instructions.

In this case, the source code is an instruction to print out

whatever is in quotation marks here, in this case, Hello World.

If we wanted to change the set of instructions, so for

example, I want to change it to print out, Hello Michigan.

Then I need to put it through the interpreter by clicking Save & Run again,

and now when I do that,

you'll see that my output changed from Hello World, to Hello Michigan.

If I want to change it back, Then I need to click Save & Run.

Now, the Python interpreter typically tries to run all of the source

code that we put in this window.

But it can sometimes be helpful to leave natural language notes or explanations for

ourselves or for other programmers who are looking at the source code.

Now the Python interpreter typically tries to run

all of the source code that we put into our source code window, but

sometimes it can be helpful to leave natural language notes or explanations for

ourselves or for other programmers looking at the source code.

In order to do that, we have what are called comments.

In Python, we write a comment by using the # symbol and

writing what we want after it.

When we write a comment, then Python ignores everything that comes after the #

symbol, meaning that we can write whatever we want here.

And on the next line, Python will start running the code again.

So if we wanted to write a comment, we would need to add a # symbol.

And what comments do are they tell the Python interpreter to ignore

these portions of the source code, and only to run what's not commented.

In our case, the only code that actually runs here is print Hello World.

Another thing that's worth noting is that the Python interpreter is not very

forgiving.

So recall that when you write source code, you're giving the computer a set of

instructions, and these instructions need to be unambiguous,

they need to follow the rules of the Python programming language.

One of the rules of Python is that when we have an open parenthesis,

then we are going to need to have a closed parenthesis.

So, let's suppose that I forget that rule and

I delete this closed parenthesis, and I try to run my program.

What happens is that I get what's called a syntax error.

A syntax error is Python saying that it doesn't understand the rules of what you

wrote, so it doesn't try to actually execute what's in the source code window.

In other words, a syntactic error or a syntax error is when

you are not following the rules of the of the Python programming language.

In this case, we are not following the rule that this open parenthesis

has to be followed by a closed parenthesis.

Throughout this course, we're going to run into syntax errors and

other kinds of errors, including run time errors and semantic errors.

So when we get a syntax error, as we will many times throughout this course,

we can fix it by editing the source code to obey the syntactic rules of

the Python programming language.

In this case, I'm going to add a close parenthesis

to match the opening parenthesis that starts out here.

Now when I click Save & Run again,

then you'll see that the syntax error disappears and my program runs again.

With that, you're already on your way to becoming a programmer.

With more practice, you'll better understand how the Python interpreter

works, and will be able to write larger, and more complex programs.

See you next time.

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