Before execution, what does CPython compile source code into?

Compiles it to bytecode, which its interpreter then runs.

Start playing free

  1. Runs each text line directly
  2. Compiles it straight to machine code
  3. Compiles it to bytecode ✔

Why: CPython compiles source code into bytecode, an internal set of instructions. Its virtual machine executes that bytecode. Cached .pyc files can let later executions skip recompilation when the source is unchanged.

Huh, didn't know that: Python's documentation calls bytecode the internal representation of a Python program in CPython.

The dad joke
Why did the Python file feel faster the second time? It already had its .pyc ready.
Like this card?
Play the game

References

Answer: Compiles it to bytecode. CPython compiles source code into bytecode, an internal set of instructions. Its virtual machine executes that bytecode. Cached .pyc files can let later executions skip recompilation when the source is unchanged.

  1. Python docs: Glossary (bytecode) docs.python.org/3/glossary.html
    Python source code is compiled into bytecode, the internal representation of a Python program in the CPython interpreter.
    Checked 2026-10-10.

Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.

Test yourself in the game