PCEP Computer Programming and Python Fundamentals Practice Question
According to PEP 8, which of the following is the recommended way to name a constant representing the maximum number of retries?
⚠ Common exam trap
The PCEP exam often tests the distinction between variable naming conventions (snake_case for variables vs. UPPER_CASE for constants) and the rule that identifiers cannot start with a digit, leading candidates to confuse camelCase or invalid names with PEP 8 recommendations.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
MAX_RETRIES
PEP 8 (Python Enhancement Proposal 8) recommends that constants be named using uppercase letters with underscores separating words, i.e., `MAX_RETRIES`. This convention distinguishes constants from regular variables, which use lowercase with underscores, and helps improve code readability and maintainability.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
MAX_RETRIES
Why this is correct
Uppercase with underscores for constants.
- ✗
max_retries
Why it's wrong here
Lowercase with underscores for variables, not constants.
- ✗
1st_retry_limit
Why it's wrong here
Cannot start with a digit.
- ✗
maxRetries
Why it's wrong here
CamelCase is for classes, not constants.
Go deeper
Related to this question
About these practice questions
One of 498 original PCEP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.