Python is Interpreted ✅
Python code is executed line by line by the Python interpreter at runtime.
This makes debugging easier but can be slower compared to compiled languages like C or Java.
👉 Example: Running a Python script (script.py)
python script.py
Python Also Uses Compilation (Bytecode Compilation) 🔄
When you run a Python script, it first compiles the code into bytecode (.pyc files).
This bytecode is then executed by the Python Virtual Machine (PVM).
👉 Steps in Python execution:
Source Code (.py) → Compiled into Bytecode (.pyc)
Bytecode (.pyc) → Executed by the PVM
Since this compilation happens behind the scenes, Python is still considered an interpreted language.
Link:
https://www.sevenmentor.com/python-course-in-solapur