A high-level, interpreted, dynamically typed language that favours readability — the most common language for interviews, scripting, data and AI.
Why Python?
How Python runs your code
Source
You write
app.py— plain text.Compile to bytecode
CPython parses it and compiles it to bytecode (cached as
__pycache__/*.pyc).Run on the PVM
The Python Virtual Machine executes the bytecode instruction by instruction — that is the “interpreted” part.
| Implementation | What it is |
|---|---|
| CPython | The reference implementation, written in C. What you get from python.org. Has the GIL. |
| PyPy | JIT-compiled — often several times faster for long-running pure-Python code. |
| Jython / IronPython | Python on the JVM / .NET (rarely used today). |
Your first program
name = "Python"
version = 3
print(f"Hello, {name} {version}!") # Hello, Python 3!
print(type(name), type(version)) # <class 'str'> <class 'int'>$ python3 --version # check the installed version
$ python3 app.py # run a file
$ python3 # interactive REPL (exit with Ctrl-D)
$ python3 -m venv .venv # create an isolated environmentStyle: PEP 8 and the Zen
4 spaces per indent level, never tabs.
snake_casefor variables and functions,PascalCasefor classes,UPPER_CASEfor constants.Lines around 79–99 characters; one statement per line.
Run
import thisto read The Zen of Python — “Readability counts.”, “Explicit is better than implicit.”