Python is a brilliant and simple to use language.
Here's how it works under the hood
( It is truly fascinating, trust me! )
Here's how it works under the hood

( It is truly fascinating, trust me! )
First of all, ๐ธ๐ฉ๐ข๐ต ๐ช๐ด ๐๐บ๐ต๐ฉ๐ฐ๐ฏ?
Python is an high-level, (mostly) interpreted programming language which is dynamically typed made by @gvanrossum ,released in 1991 as a hobby project.
Python is an high-level, (mostly) interpreted programming language which is dynamically typed made by @gvanrossum ,released in 1991 as a hobby project.
What the hell does that mean?
Let's break it down.
Let's break it down.

> Python is a ๐ต๐ถ๐ด๐ต ๐น๐ฒ๐๐ฒ๐น language.
A high level language is a language that simplifies programming for us humans.
On the left we have assembly (low-level) and Python on the right(high level)
Both output Hello World, but Python looks a hell lot less complex!
A high level language is a language that simplifies programming for us humans.
On the left we have assembly (low-level) and Python on the right(high level)
Both output Hello World, but Python looks a hell lot less complex!
In order to make python this easy to read and write, a trade off which we had to make was that it would run slower than a lower level language like assembly.
(for example the assembly code on the right might run in 0.0001 s, while the python code might run in about 0.5 s)
(for example the assembly code on the right might run in 0.0001 s, while the python code might run in about 0.5 s)
> Python is an (mostly) ๐ถ๐ป๐๐ฒ๐ฟ๐ฝ๐ฟ๐ฒ๐๐ฒ๐ฑ ๐น๐ฎ๐ป๐ด๐๐ฎ๐ด๐ฒ.
Python code (your .py file) is compiled( only step of compilation) to bytecode in a .pyc/.pyo file. This bytecode file contains instructions which is executed by your python interpreter
Python code (your .py file) is compiled( only step of compilation) to bytecode in a .pyc/.pyo file. This bytecode file contains instructions which is executed by your python interpreter

(the .exe file you installed on your computer to get python, it is installed on MacOS and linux by default)
These bytecode instructions are executed on a Virtual Machine and not on the CPU (the processor of your computer) directly.
These bytecode instructions are executed on a Virtual Machine and not on the CPU (the processor of your computer) directly.
A language like C++ is quite the opposite of python, C++ code is compiled to machine code and then run on a CPU.
> Python is a ๐ฑ๐๐ป๐ฎ๐บ๐ถ๐ฐ ๐น๐ฎ๐ป๐ด๐๐ฎ๐ด๐ฒ.
This means that the types of variables do not have to be declared like C++. This is because Python's nature of being interpreted. The interpreter does all the hard work of validating the variable's type.
This means that the types of variables do not have to be declared like C++. This is because Python's nature of being interpreted. The interpreter does all the hard work of validating the variable's type.
And that is a basic explanation on how Python works!
