MWZ

MINDWAREZONE

beginnerPython

Is Python compiled or interpreted?

Answer

Clear, interview-ready explanation

Python is both compiled and interpreted.

When using CPython, the most common Python implementation:

  1. Python source code is compiled into an intermediate format called bytecode.
  2. The Python Virtual Machine interprets and executes that bytecode.

Python may store reusable bytecode files inside a __pycache__ directory with a .pyc extension.

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.