What is Python (Visually Explained) | How It Works and How to Learn It | #Python Course 1
0:00
Sziasztok! Mi az a Python?
Hey friends, so what is Python?
0:05
Rendben, kezdjük az alapokkal. Mi az a programozási nyelv? Képzeld el, hogy feladatot akarsz adni a számítógépednek.
Okay, so now let's start with basics. What is programming language? So now imagine that you want to give your commuter a task.
0:10
Azt mondod: „Hé, számítógép, számold ki, mennyi 5 meg 5!” A számítógép viszont nem fogja érteni, pontosan miről beszélsz.
And you say, hey commuter, calculate 5 plus 5. Well, your commuter will not understand what is exactly you are talking about.
0:17
És nem történik semmi. Tehát nem használhatjuk a természetes emberi nyelvet arra, hogy feladatokat adjunk a számítógépnek.
And nothing gonna happen. So we cannot use the natural human language in order to give tasks for your PC.
0:22
Ehelyett olyan nyelven kell utasításokat adnunk, amelyet a számítógép megért.
So now instead of that, we have to give the instructions in a language where the commuter understand it.
0:27
Írunk egy rövid kódrészletet, például Pythonban: print(5 + 5).
We write a short piece of code, like for example here in Python, print 5 plus 5.
0:33
A számítógép megérti az utasítást, és eredményként 10-et ad.
Now the computer is going to understand the instruction and give us as a result 10.
0:37
A program tehát utasítások sorozata, amelyet olyan nyelven írunk, amelyet a számítógép követni tud.
So a program is like set of instructions that is written in a language the computer can follow.
0:43
De barátom, nem minden nyelv egyforma. Vannak, amelyeket embereknek, másokat pedig gépeknek alkottak.
But my friend, not all languages are the same. Some are made for people and others are made for machines.
0:49
Legfelül a természetes nyelv áll. Például azt mondod: „Kérlek, számold ki, mennyi 5 meg 5!” Sokféle természetes nyelv létezik.
So now at the top, we have the natural language. Like you say, hey, please calculate 5 plus 5. And we have a lot of natural languages.
0:55
Van angol, spanyol és hindi. Nekünk könnyűek, de a számítógépnek túl bonyolultak ahhoz, hogy megértse őket.
We have the English, Spanish, Hindi. They are easy for us but far too complex for a computer to understand.
1:02
Ezután következnek a magas szintű nyelvek. Ezek programozási nyelvek, de embereknek készültek: leegyszerűsítettek, logikusak, és könnyű írni, illetve olvasni őket.
Now moving on, then we have the high-level languages. So they are programming languages but they are made for human because they are very simplified, logical and really easy to write and to read.
1:14
Sok ilyen nyelv van, például a Python és a JavaScript. Ezek magas szintű nyelvek. Most haladjunk lefelé.
And we have a lot of languages like Python and JavaScript. They are high-level languages. Now next we are going lower.
1:21
Eljutunk az alacsony szintű nyelvekhez.
We are going to the low-level languages.
1:23
a programozási nyelvek közvetlenül kommunikálnak a gépekkel
programming languages can talk directly to the machines
1:26
de az embereknek nagyon nehezek, nehéz olvasni őket
but they are really hard for humans it's hard to read
1:29
írni és megérteni is, például ilyen
to write and as well to understand and here we have examples like
1:32
az assembly és a C nyelv, legalul pedig
the assembly and the c language and now at the very
1:35
Alul találjuk a gépi nyelvet, és ez úgy készül
bottom we have the machine language and this one is made
1:38
bináris kódból, egyesek és nullák sorozatából áll
of binary code a combination of ones and zeros
1:42
és ezt érti meg a számítógép. Az embereknek viszont lehetetlen elolvasni, megérteni vagy leírni. Ha most megnézed
and this is exactly what your computer can understand but it is impossible for humans to read it to understand it to write it so now if you look at
1:50
ezeket a szinteket, minden lefelé tett lépéssel közelebb kerülünk
these levels each step down it's gonna bring us closer
1:53
ahhoz, ahogyan a gép gondolkodik, felfelé haladva pedig
on how the machine thinks and each step up it's
1:56
közelebb kerülünk az emberi gondolkodáshoz. Ha most megnézed
gonna bring us closer on how human thinks so now if you're looking
1:59
a Pythont, ezt a magas szintű nyelvet, közelebb áll
at python the high level language it is closer to
2:02
a természetes nyelv, mint a gépi nyelv, vagyis
the natural language than the machine language so that means it
2:06
nagyon könnyű megtanulni és írni, és egyfajta absztrakció,
is really easy to learn and to write and it's like an abstraction
2:09
amely elrejti az alacsony szintű és gépi nyelvek bonyolultságát. Olyan, mint egy híd a két világ között. Pontosan ezek a programozási nyelvek, és ilyen a Python is.
that hides the complexity of low level and machine languages so it's like a bridge between both worlds so this is exactly what are programming languages and what is Python.
2:24
Rendben, most szeretném, ha pontosan megértenéd, hogyan működik a Python. Tegyük fel, hogy megnyitod a szerkesztőt, és elkezdesz Python-kódot írni.
Okay, so now I would like you to understand exactly how Python works. So let's say you open your editor and you start writing Python code.
2:30
A kódot általában egy Python-fájlba írjuk, amelynek kiterjesztése .py.
And usually we write the code inside a Python file with the file extension of py.
2:35
Itt tehát a forráskódot írod. Amikor futtatod a kódot, a számítógép nem tudja azonnal végrehajtani az utasításaidat, mert azok nagyon magas szintűek, a számítógépnek pedig alacsonyabb szintű kódra van szüksége.
So here you are writing the source code. Once you run your code, the computer cannot immediately execute your instructions because it is really high level and the computer needs a lower level of the code.
2:47
Mi történik tehát? A Pythonban van valami, amit fordítónak nevezünk. Ez fogja a Python-kódodat, és egy másik kódra fordítja.
So what happens? There is something called compiler in Python. It's going to take your Python code and translate it to another code.
2:54
Ezt bájtkódnak hívják, a kiterjesztése .pyc. A Python lefordította.
It's called the bytecode with the extension dot pyc. Python compiled.
2:59
Ez automatikusan történhet, és észre sem veszed. Mi történt tehát itt?
And this can happen automatically and you will not even notice it. So what happened here?
3:03
A Python fordítója a magas szintű nyelvet, vagyis a Python-kódot alacsony szintű nyelvre, bájtkódra fordítja.
The compiler of Python is going to translate the high-level language, the Python code, to a low-level language, the bytecode.
3:12
Ahogy láthatod, a bájtkódot nagyon nehéz megérteni a Python-kódhoz képest. A kódunk tehát még nem futott le, igaz?
So as you can see, it's really hard to understand the bytecode compared to the Python code. So now our code is not yet executed, right?
3:19
A Python csak lefordította. De mielőtt bármi lefutna, mi történhet még? A Python betölthet néhány könyvtárat is.
Python just did a translation. But now before anything to be executed, what can happen? Python might as well link some libraries.
3:26
Ezek előre megírt kódrészletek, amelyek segítenek a
It is like pre-written chunks of code that helps your
3:29
kódodnak valamilyen konkrét feladat elvégzésében, például fájlok kezelésében,
code to do something specific, like working with files
3:32
adatok feldolgozásában és így tovább. Most már a Pythonnak minden rendelkezésére áll: a
handling data and so on now python has everything the
3:35
bájtkód és a könyvtárak. Most már a Python futtathatja a
bytecode the libraries and now python can run your
3:38
bájtkódot valami, úgynevezett Python virtuális
bytecode using something called python virtual
3:41
géppel. Ez egy olyan szoftver, amely megérti a bájtkódot
machine so it's like a software that can understand the bytecode
3:45
és gondoskodik a futtatásáról. A Python
of python and take care of running it so the python
3:48
virtuális gépe végül gépi kóddá alakítja az utasításaidat:
virtual machine gonna finally convert your instructions into
3:51
gépi kódok, egyesek és nullák, mert ez az egyetlen
machine codes once and zero because this is the only
3:54
számítógéped. Ezután pedig
thing that your computer can really understand and once it's you
3:58
megjelennek az eredmények, bármit is kellett a programodnak
will see other results whatever your program was designed
4:01
csinálnia. Ezt a három lépést — fordítás, átalakítás
to do and now all those three steps compile translate
4:04
és végrehajtás — Python-értelmezőnek nevezzük.
and execute we call them the python interpreter
4:07
Olyan, mint egy eszköztár, ami mindent elintéz
so it's like a toolbox that handles everything needed
4:10
a Python-kód futtatásához. Szóval, barátom, te
to run a python code so again my friend you
4:14
magas szintű Python-kódot írsz, aztán a Python
write python code in a high language then python
4:17
lefordítja, és bájtkóddá, az alacsony szintű nyelvre alakítja. Ezután a virtuális gép mindent elintéz: fogja a bájtkódot és néhány könyvtárat, majd futtatja a számítógépeden, hogy lásd az eredményt.
compiles it and translate it into the byte code the low language and then the virtual machine gonna take care of everything gonna take your byte code some libraries and then it's gonna run it at your computer to see the results.
4:29
Ez a folyamat minden alkalommal lezajlik, amikor Python-kódot futtatsz. Mindez természetesen automatikusan, a háttérben történik.
So this process happens every time you run a Python code and everything is of course automated and behind the scenes.
4:40
Rendben, beszéljünk arról, miért érdemes egyáltalán Pythont tanulnunk. Rengeteg programozási nyelv létezik.
Okay so now let's talk about why we should learn Python in the first place. There are like too many programming languages out there.
4:46
Miért választja hát milliónyi ember a Pythont? Az első és legfontosabb ok, hogy a Python nagyon hatékony, ugyanakkor rendkívül egyszerű.
So why millions of people choose Python? So the first and most important reason is Python is very powerful and as well at the same time very simple.
4:55
Néhány sor kóddal is komoly dolgokat építhetsz.
You can build really serious stuff with few lines of codes.
4:58
Ha például a Javát és a Pythont hasonlítod össze, Java vagy C++ nyelven egy egyszerű feladathoz is sok sort kell írnod, míg Pythonban elég egy-két sor.
So if you compare like Java and Python, in Java or C++ you can write like a lot of lines in order to do a simple task compared to Python where you need only like one or two lines.
처음 5분까지만 무료로 볼 수 있어요. 이어서 보려면 앱이나 확장 프로그램을 설치하세요.
다운로드다른 언어로 요청하기





![[메이킹] 티랑이들, 힘들고 지겨울 땐 뭐다?👀 방방강쥐 임시완♥설인아 X 능글냥이 김정현♥연우 보기😍 #나의유죄인간 EP.8](https://img.youtube.com/vi/KakUksE913M/mqdefault.jpg)