nerdexam
Python_Institute

PCEP-30-02 · Question #127

The pyc file contains ...

The correct answer is C. compiled Python bytecode. When Python runs a .py file, it first compiles the source code into bytecode - a lower-level, platform-independent representation - and caches it in a .pyc file so subsequent runs can skip the compilation step and load faster. This is why C is correct: .pyc files store compiled…

Question

The pyc file contains ...

Options

  • Aa Python interpreter.
  • BPython source code.
  • Ccompiled Python bytecode.
  • Da Python compiler.

How the community answered

(47 responses)
  • A
    4% (2)
  • B
    6% (3)
  • C
    77% (36)
  • D
    13% (6)

Explanation

When Python runs a .py file, it first compiles the source code into bytecode - a lower-level, platform-independent representation - and caches it in a .pyc file so subsequent runs can skip the compilation step and load faster. This is why C is correct: .pyc files store compiled Python bytecode, not raw source.

Why the distractors are wrong:

  • A (interpreter): CPython (the interpreter) is a separate executable (python.exe/python3), not stored in .pyc files.
  • B (source code): Source code lives in .py files; .pyc is the compiled output of that source.
  • D (compiler): The compiler is part of the Python runtime itself, not packaged into .pyc files.

Memory tip: Think of .pyc as "Python compiled" - the c suffix literally stands for compiled bytecode, just like how C compilers produce .o object files from .c source files.

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice