PCEP-30-02 · Question #137
The compiled Python bytecode is stored in les having names ending with:
The correct answer is C. pyc. Python compiles source code into bytecode and stores it in files with the .pyc extension (option C) - the "c" stands for "compiled." These files are typically placed in a __pycache__ directory and allow Python to skip re-parsing unchanged source files on subsequent runs. A…
Question
Options
- Apy
- Bpyb
- Cpyc
- Dpc
How the community answered
(26 responses)- A4% (1)
- B15% (4)
- C77% (20)
- D4% (1)
Explanation
Python compiles source code into bytecode and stores it in files with the .pyc extension (option C) - the "c" stands for "compiled." These files are typically placed in a __pycache__ directory and allow Python to skip re-parsing unchanged source files on subsequent runs.
- A (
.py) - that's the source code file itself, not the compiled output. - B (
.pyb) - not a real Python file extension; a plausible-looking distractor. - D (
.pc) - also not a valid Python extension; another invented option.
Memory tip: Think .py + c for compiled → .pyc. The pattern mirrors other languages: Java uses .class, C uses .o - Python uses .pyc.
Community Discussion
No community discussion yet for this question.