beginnerPython
Previous
Why is Python called an interpreted language?
Next
What are the advantages and disadvantages of Python?
Is Python compiled or interpreted?
Answer
Clear, interview-ready explanation
Python is both compiled and interpreted.
When using CPython, the most common Python implementation:
- Python source code is compiled into an intermediate format called bytecode.
- The Python Virtual Machine interprets and executes that bytecode.
Python may store reusable bytecode files inside a directory with a __pycache__ extension.
.pyc
program.py → Python bytecode → Python Virtual Machine → Result
Therefore, saying that Python is only interpreted is a simplification. Its typical execution process includes both compilation and interpretation.